Closed chivalry closed 3 years ago
Hi @chivalry , could you share the package.json
file you are using ? I haven't been able to replicate this with the same Node & NPM versions you are on.
I just happened to have just created a new project and confirmed the above output when attempting to run npm install
. This is the package.json
that "SFDX: Create Project" generated:
{
"name": "salesforce-app",
"private": true,
"version": "1.0.0",
"description": "Salesforce App",
"scripts": {
"lint": "npm run lint:lwc && npm run lint:aura",
"lint:aura": "eslint **/aura/**",
"lint:lwc": "eslint **/lwc/**",
"test": "npm run test:unit",
"test:unit": "sfdx-lwc-jest",
"test:unit:watch": "sfdx-lwc-jest --watch",
"test:unit:debug": "sfdx-lwc-jest --debug",
"test:unit:coverage": "sfdx-lwc-jest --coverage",
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\""
},
"devDependencies": {
"@prettier/plugin-xml": "^0.12.0",
"@salesforce/eslint-config-lwc": "^0.7.0",
"@salesforce/eslint-plugin-aura": "^1.4.0",
"@salesforce/sfdx-lwc-jest": "^0.9.2",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^4.2.1",
"lint-staged": "^10.0.7",
"prettier": "^2.0.5",
"prettier-plugin-apex": "^1.6.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [
"prettier --write"
],
"**/{aura|lwc}/**": [
"eslint"
]
}
}
Note that I can get around this with npm install --force
, but I don't know if I should do that.
Thanks, I can confirm I'm using the same package.json
configs. I can think of a couple of things that can cause what you are running into. The first is that you might have globally installed a dependency that conflicts with some of the dependencies in this project. You can check for that by running npm list -g
.
If that's not the case, then you might have a conflicting copy of a dependency in your npm's cache. You can clear your npm cache or run npm install --force
should be ok since it only forces npm to download the dependencies even when you might have a local copy of them.
/usr/local/lib
├── create-react-app@3.4.1
├── express-generator@4.16.1
├── jest@26.6.1
├── knex@0.21.12
├── learnyounode@4.2.2
├── node-red@1.1.3
├── npm@7.0.3
├── sequelize-cli@6.2.0
├── typeorm@0.2.29
└── yarn@1.22.4
I npm uninstall -g
ed on all of them except npm
and node-red
and the error still happened. npm list -g
confirmed that those were the only two left:
/usr/local/lib
├── node-red@1.1.3
└── npm@7.0.3
I then ran npm install npm@latest -g
and that upgraded me to version 7.6.1. But npm install
still errors out. I finally ran npm uninstall node-red -g
and that did give an error about an inability to delete a directory, which I deleted manually with sudo rm -rf ...
. But even then, with only npm
installed globally, the command errors out.
BTW, early in the process, I also ran npm cache clean --force
.
So I don't know what could be causing this. I hope it'll be fixed when I some day do that clean install of Big Sur that I've been planning, but in the meantime, I'll run npm install --force
.
In case it helps figure out the source of the problem, here's the output of npm install --force
.
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint@7.21.0
npm WARN node_modules/eslint
npm WARN dev eslint@"^7.6.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^6.0.0" from @salesforce/eslint-config-lwc@0.7.0
npm WARN node_modules/@salesforce/eslint-config-lwc
npm WARN dev @salesforce/eslint-config-lwc@"^0.7.0" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint@7.21.0
npm WARN node_modules/eslint
npm WARN dev eslint@"^7.6.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"2.x - 6.x" from eslint-plugin-import@2.20.2
npm WARN node_modules/@salesforce/eslint-config-lwc/node_modules/eslint-plugin-import
npm WARN eslint-plugin-import@"~2.20.2" from @salesforce/eslint-config-lwc@0.7.0
npm WARN node_modules/@salesforce/eslint-config-lwc
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint@7.21.0
npm WARN node_modules/eslint
npm WARN dev eslint@"^7.6.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"2.x - 6.x" from eslint-plugin-import@2.20.2
npm WARN node_modules/@salesforce/eslint-config-lwc/node_modules/eslint-plugin-import
npm WARN eslint-plugin-import@"~2.20.2" from @salesforce/eslint-config-lwc@0.7.0
npm WARN node_modules/@salesforce/eslint-config-lwc
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint@7.21.0
npm WARN node_modules/eslint
npm WARN dev eslint@"^7.6.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-compat@3.3.0
npm WARN node_modules/@salesforce/eslint-plugin-aura/node_modules/eslint-plugin-compat
npm WARN eslint-plugin-compat@"3.3.0" from @salesforce/eslint-plugin-aura@1.4.0
npm WARN node_modules/@salesforce/eslint-plugin-aura
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint@7.21.0
npm WARN node_modules/eslint
npm WARN dev eslint@"^7.6.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-compat@3.3.0
npm WARN node_modules/@salesforce/eslint-plugin-aura/node_modules/eslint-plugin-compat
npm WARN eslint-plugin-compat@"3.3.0" from @salesforce/eslint-plugin-aura@1.4.0
npm WARN node_modules/@salesforce/eslint-plugin-aura
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mdn-browser-compat-data@0.0.84: mdn-browser-compat-data is deprecated. Upgrade to @mdn/browser-compat-data. Learn more: https://github.com/mdn/browser-compat-data/blob/v1.1.2/UPGRADE-2.0.x.md
added 1097 packages, and audited 1098 packages in 43s
79 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Hi @chivalry - I'm glad you are unblocked
Summary
Creating a project with the SFDX integration, attempting to install the dependences in the generated
package.json
results in an error.Steps To Reproduce:
SFDX: Create Project
.npm install
.Expected result
I would expect that
npm
would install the packages listed inpackage.json
.Actual result
I got the following output:
Additional information
I'm rather new to this entire environment of Salesforce DX, Node, etc., so my guess is that if I knew more about what I was doing, the error information above and the disparate versions of
node
andnpm
would be sufficient for me to fix the problem, but I don't even know why there are three different versions of node (the VS Code version, the SFDX CLI version and the version reported in the terminal). I'm guessing that has something to do with it.VS Code Version:
Version: 1.54.0 Commit: 42e27fe5cdc58539dad9867970326a297eb8cacf Date: 2021-03-03T02:17:59.499Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Darwin x64 19.6.0
SFDX CLI Version: sfdx-cli/7.88.4-3b2e55c3f1 darwin-x64 node-v14.15.4
OS and version: macOS 10.15.7
node
version: (output ofnode --version
in terminal) 15.0.1npm
version: (output ofnpm --version
in terminal) 7.0.3