You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the process.env.INIT_CWD returns undefined on npm 7.0.2
If you change the npm version to something below it will work with no problem.
You can reproduce the problem by creating a simple js file and run it as script on the package.json file (in order to make it run with the npm). For example
javascript.js
console.log(process.env.INIT_CWD)
package.json
.... THE NORMAL THINGS
"scripts": { "runme": "node ./javascript.js" }
.... THE NORMAL THINGS
And then run: npm run runme
This will shout you on the shell/bash/what you use: undefined
With other versions on npm will show the path of where the npm is called (the normal behaviour).
The text was updated successfully, but these errors were encountered:
Quick update on this: I can confirm the same behaviour with [email protected] ..
In the mean time a bug report has been opened on the NPM github about INIT_CWD missing: npm/cli#2033. This is what ultimately is breaking things. So let's keep an eye on that one.
In the mean time I will apply an extra check for the existence of INIT_CWD to the SDK install script, so it won't error out.
Hi,
If you have npm version 7.0.2 (included on node 15) you are unable to install lightning/sdk because the post-install scripts fails:
This error shows that the line that is failing is:
const packageJson = require(path.join(process.env.INIT_CWD, 'package.json'))
Because the
process.env.INIT_CWD
returns undefined on npm 7.0.2If you change the npm version to something below it will work with no problem.
You can reproduce the problem by creating a simple js file and run it as script on the package.json file (in order to make it run with the npm). For example
javascript.js
package.json
And then run: npm run runme
This will shout you on the shell/bash/what you use: undefined
With other versions on npm will show the path of where the npm is called (the normal behaviour).
The text was updated successfully, but these errors were encountered: