Closed jhderojasUVa closed 4 years ago
Quick update on this: I can confirm the same behaviour with npm@7.0.3 ..
In the mean time a bug report has been opened on the NPM github about INIT_CWD
missing: https://github.com/npm/cli/issues/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.
The fix is working. Now it's time to wait until the official patch into npm or merge this :)
Cool! Merged into the dev-branch. Will be released soon.
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).