简体   繁体   中英

"npm install" don't install file node_mdule (node-gyp error)

I have been trying to solve this error for 2 days. I check a lot of solutions inside inte.net (and stackoverflow) and I'm desperate looking for help.

So, inside my project when I write:

npm install

I had errer:

npm ERR! code 7
npm ERR! path C:\Users\dagma\FinsekaApp\deploy_harveFix2\client\node_modules\iltorb
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./scripts/install.js || node-gyp rebuild
npm ERR! info install installing standalone, skipping download.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! (node:11728) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will 
be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn C:\Python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-G',
npm ERR! gyp info spawn args   'msvs_version=2015',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\iltorb\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\dagma\\.node-gyp\\16.13.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\dagma\\.node-gyp\\16.13.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\dagma\\.node-gyp\\16.13.1\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\iltorb',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\iltorb\\build',     
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe       
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:477:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dagma\\FinsekaApp\\deploy_harveFix2\\client\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\dagma\FinsekaApp\deploy_harveFix2\client\node_modules\iltorb
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! This is a bug in `node-gyp`.
npm ERR! gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm ERR! gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dagma\AppData\Local\npm-cache\_logs\2021-12-12T04_31_50_053Z-debug-0.log

I have installed:

NodeJS: v16.13.1

npm: 8.3.0

python: 3.9.0

Visual Studio 2019

For those trying to install node-gyp with no inte.net access:

To setup node headers for node-gyp:

  • Get the node headers file: curl -O https://nodejs.org/dist/v14.17.3/node-v14.17.3-headers.tar.gz (make sure you have the correct node version appropriate, and you need a machine with inte.net)
  • Copy header tarball to offline machine (approach may vary depending on your situation an example may be to winscp to vm)
  • Create the node-gyp folder that the library looks for if it's not already existing : mkdir -p ~/.cache/node-gyp/14.17.3 (PITFALL: in some versions node-gyp folder is under ~/.node-gyp )
  • tar the file to node-gyp folder : tar -xf node-v14.17.3-headers.tar.gz --directory ~/.cache/.node-gyp/6.10.1/ --strip-components 1 (make sure you have the correct versions here)
  • create the installVersion manually : echo 9 >~/.node-gyp/6.10.1/installVersion (usually it is created automatically if you have inte.net access)

Please try using npm init -y first(creates a 'package.json' file that tracks all the dependencies) and then try the npm install command.

Same problem here.

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 9009. [C:\Users\User\Workplace_repo\project\project-fe\node_modules\cpu-features\build\config_deps.vcxproj] gyp ERR: build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR. stack at ChildProcess:onExit (C.\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build:js:194.23) gyp ERR. stack at ChildProcess:emit (events:js.315.20) gyp ERR. stack at Process.ChildProcess:_handle:onexit (internal/child_process.js.277:12) gyp ERR. System Windows_NT 10.0.19043 gyp ERR. cwd C:\Users\User\Workplace_repo\project\project-fe\node_modules\cpu-features gyp ERR! node -v v14.15.4 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

I've deleted note_modules, package-lock.json also package.json. Afer that i've used npm install command, and i've receive the same errors.

Any idea?

Thanks, Andrew

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM