在OSX上运行,节点版本0.12.0,正在运行
npm install --production
对于Ghost尝试安装sqlite3 v.3.0.4我收到以下错误:
> node-pre-gyp install --fallback-to-build
child_process: customFds option is deprecated, use stdio instead. gyp: /Users/USER/.node/common.gypi not found (cwd:
/Users/USER/Documents/personal_website/ghost/node_modules/sqlite3) while reading includes of binding.gyp while trying to load binding.gyp gyp
ERR! configure error gyp
ERR! stack Error: `gyp` failed with exit code: 1 gyp
ERR! stack at ChildProcess.onCpExit
(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at
Process.ChildProcess._handle.onexit (child_process.js:1067:12) gyp
ERR! System Darwin 14.1.0 gyp ERR! command "node"
"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=sqlite3" "--configuration=Release" "--module_name=node_sqlite3" "--version=3.0.4" "--major=3" "--patch=4" "--runtime=node" "--node_abi=node-v14" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./lib/sqlite3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=/Users/USER/Documents/personal_website/ghost/node_modules/sqlite3/lib/binding/node-v14-darwin-x64" "--module=/Users/USER/Documents/personal_website/ghost/node_modules/sqlite3/lib/binding/node-v14-darwin-x64/node_sqlite3.node" "--remote_path=./sqlite3/v3.0.4/" "--package_name=node-v14-darwin-x64.tar.gz" "--staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-darwin-x64.tar.gz" "--hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/" "--hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-darwin-x64.tar.gz" "--nodedir=/Users/USER/.node" gyp
ERR! cwd /Users/USER/Documents/personal_website/ghost/node_modules/sqlite3 gyp
ERR! node -v v0.12.0 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--production"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! sqlite3@3.0.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.0.4 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
我的PATH中有/ usr / local / share / npm / bin。
答案 0 :(得分:1)
尝试安装ghost时,我也遇到了这个错误。看起来node-sqlite3出了问题,因为我看到其他人发布了这个错误。一旦node-sqlite3被修复,可能会出现更多问题:
Ghost目前还不支持节点0.12.x。来自README.md:
Ghost需要Node v0.10.x
https://github.com/TryGhost/Ghost/issues/4240
有更多信息我可能最终会安装旧版本的节点,直到ghost发布新版本。
答案 1 :(得分:1)
npm i sqlite3 --build-from-source
可能会有效
答案 2 :(得分:0)
我也得到了这个错误。使用npm版本2.5.1将nodejs降级到0.10.9后,我可以npm install --production
无误地执行
答案 3 :(得分:0)
如果您直接从github repo下载Ghost,则由于package.json
文件而导致的许多问题已经解决。
例如,您有一些显着的更改可以解决一些安装问题:
"engines": {
"node": "~0.10.0 || ~0.12.0",
"iojs": "~1.2.0"
},
还有依赖:
"html-to-text": "1.2.0",
"sqlite3": "3.0.5",
答案 4 :(得分:0)
控制台显示如下:
node pre gyp install --fallback-to-build
这是安装到32位版本。 等待一段时间,它会自动变为64位。 没关系。