@aws-sdk/client-cognito-identity-provider ENOENT: no such file or directory, lstat '/path/to/process'

0

I have paid AWS Support, and have created a case verbatim to what's provided below. The only thing I'm trying to do in "Cognito, SDK" is import the @aws-sdk/client-cognito-identity-provider. I have no questions regarding how to use it and any custom/coding/syntax, only "why doesn't it import". Since this is an AWS SDK, I thought it was appropriate that I would create an AWS Support case categorized in AWS "Cognito SDK" (as well as "Amplify Framework, JavaScript" category). However, I'm not sure whether paid AWS support includes SDK support created/maintained by AWS, or whether AWS Support engineers in the "Cognito SDK" and support engineers in the "Amplify Framework, JavaScript" do not understand the AWS SDK they maintain/created/manage. I want to stress my question has nothing to do with how to use Cognito SDK, merely why it cannot be imported. So, here I am asking the public if they know why AWS SDK is not working. It does seem weird that paid support is not capable of providing support that promote/advertise their service/support through the tagging mechanisms within the support case itself (tagging case as "Cognito SDK", "Amplify Framework, JavaScript").

Hello,

Greetings from AWS premium support.

Thank you for contacting us, my name is Khurram and I will be assisting you with this case today.

From the case correspondence, I understand that you are importing aws-sdk/client-cognito-identity-provider library into your code and getting some errors.

I would like to mention that as a support engineer, our expertise are with Cognito service only and any assistance specific to AWS SDK or code related support is out of scope since we have limited code experience[1]. I sincerely apologize for the inconvenience caused due to this.

As a workaround, you can open a GitHub issue[2] with our AWS SDK team and provide them details of your problem. This page is directly managed by our development team who hold their expertise in their related field. Reporting the problem directly on that page will ensure that the contributors managing the concerned page will be aware of the situation and will be able to help you with your query more efficiently as they hold their expertise in that field and will be in a better position to comment on the issue.

However, I am referencing a few links [3][4] on best effort basis which might be helpful for you. In case you have any questions/queries regarding Cognito service please do not hesitate to reach out and I will be more than happy to help.

Thanks again

Have a nice day.

References

[1] - https://aws.amazon.com/premiumsupport/faqs/ [2] - https://github.com/aws/aws-sdk-js-v3/issues [3] - https://www.npmjs.com/package/@aws-sdk/client-cognito-identity-provider [4] - https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cognito-identity-provider/index.html

We value your feedback. Please share your experience by rating this and other correspondences in the AWS Support Center. You can rate a correspondence by selecting the stars in the top right corner of the correspondence.

Best regards, Khurram A. Amazon Web Services

The above case response does seem very generic like a (Chat)GPT that doesn't know what it's talking about, or just provides generic statements.


Support Case

Now using node v14.21.2 (npm v6.14.17)
Updating is_local.js with desired values
Updating aws-exports.js with desired values
Notice: compiling javascript

> reactjs@1.0.0 build:browserify /path/to/pooPooCodeBase/jsx
> browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/path/to/pooPooCodeBase/jsx/process'
    required by /path/to/pooPooCodeBase/jsx/node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs@1.0.0 build:browserify: `browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the reactjs@1.0.0 build:browserify script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jeff1evesque/.npm/_logs/2023-11-01T03_50_45_222Z-debug.log

I have the following packages.json:

{
  "name": "reactjs",
  "version": "1.0.0",
  "description": "packages needed for source files.",
  "main": "index.js",
  "scripts": {
    "prebuild:dos2unix": "find . -type f -print0 | xargs -0 dos2unix",
    "build:browserify": "browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js",
    "watch:jsx": "onchange '**/*.jsx' '**/*.js' -- npm run build:browserify",
    "test": "NODE_ENV=test jest --config jest.config.js",
    "report:coveralls": "cat lcov.info | ./node_modules/coveralls/bin/coveralls.js"
  },
  "author": "Jeff1evesque",
  "license": "BSD",
  "repository": "github:jeff1evesque/pooPooCodeBase",
  "dependencies": {
    "@aws-amplify/auth": "^5.6.5",
    "@aws-sdk/client-cognito-identity-provider": "^3.350.0",
    "@babel/core": "^7.22.11",
    "@babel/plugin-proposal-class-properties": "^7.18.6",
    "@babel/plugin-transform-runtime": "^7.22.10",
    "@babel/preset-env": "^7.22.10",
    "@babel/preset-react": "^7.22.5",
    "@popperjs/core": "^2.8.1",
    "@wojtekmaj/enzyme-adapter-react-17": "^0.4.1",
    "babel-jest": "^26.6.3",
    "babelify": "^10.0.0",
    "browserify": "^17.0.0",
    "coveralls": "^3.1.0",
    "d3": "^6.5.0",
    "dos2unix-cli": "^1.0.1",
    "enzyme": "^3.11.0",
    "framer-motion": "^10.16.2",
    "global": "^4.4.0",
    "history": "^5.0.0",
    "jest-cli": "^26.6.3",
    "recharts": "^2.6.2",
    "onchange": "^7.1.0",
    "promise-polyfill": "^8.2.0",
    "prop-types": "15.7.2",
    "query-string": "^6.14.0",
    "react": "^18.0.0",
    "react-bootstrap": "^2.7.2",
    "react-csv-to-table": "^0.0.4",
    "react-datepicker": "^4.8.0",
    "react-dom": "^18.0.0",
    "react-error-boundary": "^3.1.0",
    "react-gauge-chart": "^0.3.0",
    "react-json-view": "1.21.1",
    "react-papaparse": "^4.1.0",
    "react-redux": "^7.2.2",
    "react-router-dom": "^6.8.0",
    "react-modal-sheet": "^2.0.0",
    "react-tabs": "^4.2.1",
    "react-qr-code": "^2.0.12",
    "rearm": "^0.13.1",
    "redux": "^4.0.5",
    "whatwg-fetch": "^3.4.1",
    "react-device-detect": "^2.2.3",
    "@mui/material": "^5.14.7",
    "@mui/icons-material": "^5.14.9",
    "@emotion/styled": "^11.11.0",
    "@emotion/react": "^11.11.1",
    "react-alice-carousel": "^2.7.1",
    "react-spinners": "^0.13.8"
  }
}

I run npm install no problem:

(base) jeff1evesque@computer jsx % npm install

up to date, audited 1584 packages in 3s

124 packages are looking for funding
  run `npm fund` for details

17 vulnerabilities (5 moderate, 11 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

Then, I have a react/jsx template with the following import:

import * as AWS from "@aws-sdk/client-cognito-identity-provider";

When I run npm run build:browserify, I get the following error:

(base) jeff1evesque@computer pooPooCodeBase % npm run build:browserify
Now using node v14.21.2 (npm v6.14.17)
Updating is_local.js with desired values
Updating aws-exports.js with desired values
Notice: compiling javascript

> reactjs@1.0.0 build:browserify /path/to/pooPooCodeBase/jsx
> browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/path/to/pooPooCodeBase/jsx/process'
    required by /path/to/pooPooCodeBase/jsx/node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs@1.0.0 build:browserify: `browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the reactjs@1.0.0 build:browserify script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jeff1evesque/.npm/_logs/2023-11-02T00_56_48_364Z-debug.log

I expect being able to import the @aws-sdk/client-cognito-identity-provider module. That's my only goal at the moment.

Additional Information/Context

(base) jeff1evesque@computer pooPooCodeBase % cat /Users/jeff1evesque/.npm/_logs/2023-11-02T00_56_48_364Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/jeff1evesque/.nvm/versions/node/v14.21.2/bin/node',
1 verbose cli   '/Users/jeff1evesque/.nvm/versions/node/v14.21.2/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build:browserify'
1 verbose cli ]
2 info using npm@6.14.17
3 info using node@v14.21.2
4 verbose run-script [ 'prebuild:browserify', 'build:browserify', 'postbuild:browserify' ]
5 info lifecycle reactjs@1.0.0~prebuild:browserify: reactjs@1.0.0
6 info lifecycle reactjs@1.0.0~build:browserify: reactjs@1.0.0
7 verbose lifecycle reactjs@1.0.0~build:browserify: unsafe-perm in lifecycle true
8 verbose lifecycle reactjs@1.0.0~build:browserify: PATH: /Users/jeff1evesque/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/jeff1evesque/application/pooPooCodeBase/jsx/node_modules/.bin:/Users/jeff1evesque/.nvm/versions/node/v14.21.2/bin:/Users/jeff1evesque/.pyenv/shims:/Users/jeff1evesque/opt/miniconda3/bin:/Users/jeff1evesque/opt/miniconda3/condabin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
9 verbose lifecycle reactjs@1.0.0~build:browserify: CWD: /Users/jeff1evesque/application/pooPooCodeBase/jsx
10 silly lifecycle reactjs@1.0.0~build:browserify: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js'
10 silly lifecycle ]
11 silly lifecycle reactjs@1.0.0~build:browserify: Returned: code: 1  signal: null
12 info lifecycle reactjs@1.0.0~build:browserify: Failed to exec build:browserify script
13 verbose stack Error: reactjs@1.0.0 build:browserify: `browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/jeff1evesque/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:400:28)
13 verbose stack     at ChildProcess.<anonymous> (/Users/jeff1evesque/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:400:28)
13 verbose stack     at maybeClose (internal/child_process.js:1088:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
14 verbose pkgid reactjs@1.0.0
15 verbose cwd /Users/jeff1evesque/application/pooPooCodeBase/jsx
16 verbose Darwin 22.5.0
17 verbose argv "/Users/jeff1evesque/.nvm/versions/node/v14.21.2/bin/node" "/Users/jeff1evesque/.nvm/versions/node/v14.21.2/bin/npm" "run" "build:browserify"
18 verbose node v14.21.2
19 verbose npm  v6.14.17
20 error code ELIFECYCLE
21 error errno 1
22 error reactjs@1.0.0 build:browserify: `browserify -t [ babelify --presets [ @babel/preset-env ] ] content.jsx > content.js`
22 error Exit status 1
23 error Failed at the reactjs@1.0.0 build:browserify script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
3 Answers
0

Hello Jeff,

I sincerely apologize for the frustration this has caused. I've forwarded your concerns to the appropriate Support team for review. Please keep an eye on your case for a reply from them.

— Brian D.

profile pictureAWS
EXPERT
answered 6 months ago
  • Yes sir, thank you! I got a response in the case roughly 7 days ago saying "Please be assured that your case is taken care of", and still waiting for some additional feedback. I have other things to work on, not a big deal at the moment.

0

Just got response from paid support:

Hello there,

I hope you are well. My name is Asithandile from AWS Premium Support and I have taken ownership of this case.

First, I would like to extend my sincerest apologies for the delayed response.

We have received feedback from the internal team with regards to your case. Engineer (@RanVaknin) has added a response to your query on the github issue opened in out repo: https://github.com/aws/aws-sdk-js-v3/issues/5445

I trust the above is helpful. Please reach out to us if you have any further queries or concerns, we will be happy to assist you further.

Have a nice day ahead!

We value your feedback. Please share your experience by rating this and other correspondences in the AWS Support Center. You can rate a correspondence by selecting the stars in the top right corner of the correspondence.

Best regards, Asithandile G. Amazon Web Services

Firstly, still weird that first response for paid support to a ticket created in “Cognito SDK” was that SDK support was outside support. Secondly, paid “Cognito SDK” support didn’t do anything except parse a public GitHub issue I created. That defeats the purpose of paid “Cognito Support”. I would recommend AWS remove the option of “Cognito SDK” attribute selection when creating Cognito cases by paying customers. For those kind of cases you guys can get rid of human paid support engineers and stand up a ChatGPT that just opens/interfaces with public GitHub issues, then possibly give those “internal engineers” which are public facing engineers a raise.

answered 5 months ago
0

Got a response on a parallel case I opened within the "Amplify, Javascript" case:

Hello,

Thank you for contacting AWS Premium Support. My name is Bathande, and I will be assisting you today.

From the case description, I understand you are experiencing an issue where you are unable to import the “@aws-sdk/client-cognito-identity-provider” module in your application due to “Error: Can't walk dependency graph: ENOENT: no such file or directory”. Let me know if I misunderstood the issue.

Please note that “@aws-sdk/client-cognito-identity-provider” is owned by the Cognito team, and it is not used or related to Amplify. With that said, the issue seems to be related to the package browserify that is used because I was able to import the Cognito package directly. I was able to find a workaround online. To mitigate the issue, you will need to install the process package 1, then create a file called package as stated in 2.

Please note that AWS support engineers are not at liberty to provide code support (both code debugging and code development), as stated in 3. I should also mention that my expertise is only limited to Amplify in this case, and the issue is not related to Amplify. Furthermore, I am not an expert in reactjs; the suggestions are what I found online and tested in my environment. Therefore, please test this in your testing environment before moving to production.

Should you have any questions or concerns, please feel free to reach out to me; I will gladly assist.

Reference

We value your feedback. Please share your experience by rating this and other correspondences in the AWS Support Center. You can rate a correspondence by selecting the stars in the top right corner of the correspondence.

Best regards, Bathande N. Amazon Web Services

I would have to agree on the case/bug reported it's related to "Cognito SDK", and I appreciate the effort by the "Amplify, Javascript" team. However, I do want to mention 2 things:

1.) before I even attempted "Cognito SDK" myself, then opening a ticket with the "Cognito SDK" team, I tried to do what I wanted using the Amplify framework with "javascript" => "Amplify, Javascript"

2.) that being said, maybe I'll revert my effort with "Cognito SDK" and use "Amplify, Javascript" and open a case with AWS Support in the "Amplify, Javascript" case regarding javascript assistance for the amplify framework

Again, if "Amplify, Javascript" is not covered in AWS Support, I would remove the option for paying customers from being able to open "Amplify, Javascript" cases on the AWS Management Console. I would get rid of paid AWS Support engineers within the "Amplify, Javascript" team, and reallocate a ChatGPT in lieu to interface with AWS Repost, and AWS public GitHub maybe.

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions