我一直在尝试为两个项目安装依赖项,而安装xml2json
和ursa
软件包时遇到了类似的错误:
xml2json
:
C:\Users\home\Projects\project1\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "pangyp" rebuild )
module.js:491
throw err;
^
Error: Cannot find module 'C:\Users\home\Projects\project1\node_modules\node-expat\pangyp'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
ursa
:
C:\Users\home\Projects\project2\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "pangyp" rebuild )
module.js:491
throw err;
^
Error: Cannot find module 'C:\Users\home\Projects\project2\node_modules\ursa\pangyp'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
版本:
node v8.4.0
npm 5.3.0
Windows 7 Ultimate 64
我运行npm rebuild node-expat
发髻无效。