采用npm install jquery 无法安装。
发布于 4 年前 作者 mrlong 7178 次浏览 最后一次编辑是 10 个月前
1.cmd 已用管理员账号运行
2.win7操作系统 64位
3.提示如下:
C:\Program Files\nodejs>npm install jquery npm http GET https://registry.npmjs.org/jquery npm http 304 https://registry.npmjs.org/jquery npm http GET https://registry.npmjs.org/htmlparser/1.7.6 npm http GET https://registry.npmjs.org/navigator npm http GET https://registry.npmjs.org/location/0.0.1 npm http GET https://registry.npmjs.org/contextify npm http GET https://registry.npmjs.org/xmlhttprequest npm http GET https://registry.npmjs.org/jsdom npm http 304 https://registry.npmjs.org/contextify npm http 304 https://registry.npmjs.org/navigator npm http 304 https://registry.npmjs.org/xmlhttprequest npm http 304 https://registry.npmjs.org/location/0.0.1 npm http 304 https://registry.npmjs.org/htmlparser/1.7.6 npm http 304 https://registry.npmjs.org/jsdom npm http GET https://registry.npmjs.org/bindings npm http GET https://registry.npmjs.org/cssom npm http GET https://registry.npmjs.org/cssstyle npm http 304 https://registry.npmjs.org/bindings
contextify@0.1.6 install C:\Program Files\nodejs\node_modules\jquery\node_modu les\contextify node-gyp rebuild
C:\Program Files\nodejs\node_modules\jquery\node_modules\contextify>node “C:\Pro
gram Files\nodejs\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp
\bin\node-gyp.js” rebuild
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/cssstyle
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: 项目“contextify.vcxproj”的平台无效。平台为“x64
”。您会看到此消息的可能原
因是,您尝试在没有解决方案文件的情况下生成项目,并且为此项目指定了并不存在的非默
认平台。 [C:\Program Files\nodejs\node_modu
les\jquery\node_modules\contextify\build\contextify.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: c:\Windows\Microsoft.NET\Framework\v4.0.30319\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:267:23)
gyp ERR! stack
at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack
at Process.ChildProcess._handle.onexit (child_process.js:789:
gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command “node” “C:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js” "rebuild" gyp ERR! cwd C:\Program Files\nodejs\node_modules\jquery\node_modules\contextify
gyp ERR! node -v v0.10.18 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0
C:\Program Files\nodejs>