Part 3, Uploading Files-7, npm install fails

Anybody manage to successfully run the command npm install?

I get a bunch of warnings, but also a bunch of error messages (see below)
Anyhow, anybody knows what to do about that?
Honestly, i have no clue about node or npm …

PS C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client> npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient…
npm WARN old lockfile
npm WARN deprecated source-map-url@0.4.1: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
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 GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated source-map-resolve@0.5.3: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform’s native performance.now() and performance.timeOrigin.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated parcel-bundler@1.12.5: Parcel v1 is no longer maintained. Please migrate to v2, which is published under the ‘parcel’ package. See Migration for details.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup ‘C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client\node_modules’,
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir ‘C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client\node_modules\csso\node_modules\css-tree’] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: ‘EPERM’,
npm WARN cleanup syscall: ‘rmdir’,
npm WARN cleanup path: ‘C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client\node_modules\csso\node_modules\css-tree’
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.15.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.1 found at “C:\Users\bloca\AppData\Local\Programs\Python\Python311\python.exe”
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with ‘–loglevel silly’ for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the “Desktop development with C++” workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:369:14)
npm ERR! gyp ERR! stack at C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:390:16
npm ERR! gyp ERR! stack at C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\bloca\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
npm ERR! gyp ERR! cwd C:\Users\bloca\OneDrive\Documents\Django 3- Resources\Code\2- Uploading Files\Client App\storefront3_client\node_modules\deasync
npm ERR! gyp ERR! node -v v18.15.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed

npm ERR! A complete log of this run can be found in: C:\Users\bloca\AppData\Local\npm-cache_logs\2023-03-31T20_16_19_576Z-debug-0.log

hey dear, I’ve come accross with the same issue now, have you fixed it ?
could you please share your solution found to fix it and succesfully done “npm install” ?

thank you

When you installed nodejs, did you check the box to automatically install the necessary tools? At first I checked the box and was getting the same errors. I uninstalled nodejs and reinstalled it without checking that box and now it’s working. Hope that helps!
image

I ran into the same errors since I’m using the latest version of the libraries. At the time of this comment, I’m using the following:
code --version
1.83.1
node --version
v18.18.2

I get a similar list of warnings and errors from npm install:
npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient…
npm WARN old lockfile
npm WARN deprecated @babel/plugin-proposal-private-property-in-object@7.15.4: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm WARN deprecated @babel/plugin-proposal-private-methods@7.14.5: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated @babel/plugin-proposal-unicode-property-regex@7.14.5: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.

… blah blah blah…

npm ERR! code 1
npm ERR! path C:\Users\jknospe\Desktop\Projects\storefront3_client\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.6 found at “C:\Users\jknospe\AppData\Local\Programs\Python\Python311\python.exe”
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with ‘–loglevel silly’ for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the “Desktop development with C++” workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:380:14)
npm ERR! gyp ERR! stack at C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
npm ERR! gyp ERR! stack at C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:401:16
npm ERR! gyp ERR! stack at C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:430:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\jknospe\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
npm ERR! gyp ERR! cwd C:\Users\jknospe\Desktop\Projects\storefront3_client\node_modules\deasync
npm ERR! gyp ERR! node -v v18.18.2
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed

npm ERR! A complete log of this run can be found in: C:\Users\jknospe\AppData\Local\npm-cache_logs\2023-10-23T23_41_46_223Z-debug-0.log

Here’s how to fix this. Open the package.json file. It looks like this:

{
“name”: “storefront2_client”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“start”: “parcel index.html -p 8001”,
“test”: “echo "Error: no test specified" && exit 1”
},
“keywords”: ,
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“axios”: “^0.23.0”
},
“devDependencies”: {
“parcel-bundler”: “^1.12.5”
}
}

Note the older version of software and “parcel-bundler” which is depricated.

Update the file to look like this:

{
“name”: “storefront2_client”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“start”: “parcel index.html -p 8001”,
“test”: “echo "Error: no test specified" && exit 1”
},
“keywords”: ,
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“axios”: “"
},
“devDependencies”: {
“parcel”: "

}
}

Basically replace the old version numbers with * and parcel-bundler to just parcel.
Then run “npm install”, and then execute “npm start”. The server should run.

Best of luck!

2 Likes

thanks, that helped. After applying that fix on the package.json I was getting an error of ‘… no such file and directory’, with quite a long path, so I moved the storefront3_client folder to ~/ and opened it form there and worked ok.

Thanks, jknospe, making your edits to the package.json file fixed my issue as well