使用以下命令: npm install jsdom,在尝试启动并运行jsdom以与node.js服务器一起使用时,我得到了以下一系列错误。有人能帮我澄清一下这个问题吗?我认为可能还有一个问题,因为它不能提前安装contextify...thanks!
npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/htmlparser
npm WARN package.json cssom@0.2.5 No README.md file found!
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> contextify@0.1.3 install /Users/dereklo/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild
gyp ERR! rebuild error Error: not found: make
gyp ERR! rebuild error at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! rebuild error at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! rebuild error at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! rebuild error at Object.oncomplete (fs.js:297:15)
gyp ERR! not ok
npm WARN optional dep failed, continuing contextify@0.1.3
jsdom@0.2.15 node_modules/jsdom
├── cssom@0.2.5
└── htmlparser@1.7.6发布于 2012-07-22 00:19:10
您需要使用GCC来编译这些node.js模块。
”之后的“安装”按钮上转到Xcode
完成!:)
发布于 2014-06-29 21:00:43
在确保安装了XCode命令行工具之后,我的npm install jsdom仍然有问题。原来我还在运行我的节点服务器,所以安装会失败。对于可能遇到此问题的其他任何人,请确保按Ctrl +C停止您的服务器,然后执行npm install jsdom。像护身符一样工作!:)
发布于 2022-01-01 09:41:34
以上不适用于我(Mac上的Node版本16.13.0 )。我注意到了node-pre-gyp WARN Pre-built binaries not installable for canvas@2.6.1 and node@16.13.0错误的一部分。
,所以我使用了Node14.18.2版(使用 ),而不是,这在我的例子中很好。
(我认为这会跳过编译,并使用预构建版本。)
然后,npm install按照预期工作。
https://stackoverflow.com/questions/11570034
复制相似问题