安装 ghost 遇到问题

环境信息: debian 7.8 apache mysql php

1、安装编译包
sudo apt-get install python g++ make checkinstall

2、获取最新的 node 源码
mkdir /home/bags && cd /home/bags
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*

3、配置编译源码
./configure
sudo checkinstall*

4、安装(-i)和卸载(-r)
sudo dpkg -i node_*
sudo dpkg -r node

5、 查看 nodejs 和 npm 的版本
node -v
npm -v

6、下载ghost
wget -N https://en.ghost.org/archives/ghost-0.5.8.zip
mkdir ghost && cp -p ghost-0.5.8.zip ghost
rm -rf ghost-0.5.8.zip 
unzip ghost-0.5.8.zip -d ghost

7、进入ghost文件下
npm install --production

sqlite3@3.0.4 install /home/bags/ghost/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/bags/ghost/node_modules/sqlite3/build'
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080701/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080701/sqlite3.o
AR(target) Release/obj.target/deps/sqlite3.a
COPY Release/sqlite3.a
CXX(target) Release/obj.target/node_sqlite3/src/database.o
../src/database.cc: In static member function 'static void node_sqlite3::Database::New(const v8::FunctionCallbackInfo<v8::Value>&)':
../src/database.cc:134:71: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>, v8::PropertyAttribute)'
../src/database.cc:134:71: note: candidates are:
In file included from /root/.node-gyp/0.12.0/src/node.h:61:0,
             from ../src/database.cc:2:
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>)
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note:   candidate expects 2 arguments, 3 provided
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>)
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note:   candidate expects 2 arguments, 3 provided
../src/database.cc:135:69: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::Integer>, v8::PropertyAttribute)'
../src/database.cc:135:69: note: candidates are:
In file included from /root/.node-gyp/0.12.0/src/node.h:61:0,
             from ../src/database.cc:2:
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>)
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2112:8: note:   candidate expects 2 arguments, 3 provided
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note: bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>)
/root/.node-gyp/0.12.0/deps/v8/include/v8.h:2114:8: note:   candidate expects 2 arguments, 3 provided
../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)':
../src/database.cc:145:9: warning: unused variable 'status' [-Wunused-variable]
../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)':
../src/database.cc:230:9: warning: unused variable 'status' [-Wunused-variable]
../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)':
../src/database.cc:509:9: warning: unused variable 'status' [-Wunused-variable]
../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)':
../src/database.cc:610:9: warning: unused variable 'status' [-Wunused-variable]
make: *** [Release/obj.target/node_sqlite3/src/database.o] 错误 1
make: Leaving directory `/home/bags/ghost/node_modules/sqlite3/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
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 Linux 3.2.0-4-amd64
gyp ERR! command "/usr/local/bin/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=linux" "--target_platform=linux" "--arch=x64" "--target_arch=x64" "--module_main=./lib/sqlite3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64" "--module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node" "--remote_path=./sqlite3/v3.0.4/" "--package_name=node-v14-linux-x64.tar.gz" "--staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-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-linux-x64.tar.gz"
gyp ERR! cwd /home/bags/ghost/node_modules/sqlite3
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/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=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-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-linux-x64.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/bags/ghost/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1008:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
node-pre-gyp ERR! System Linux 3.2.0-4-amd64
node-pre-gyp ERR! command "node" "/home/bags/ghost/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/bags/ghost/node_modules/sqlite3
node-pre-gyp ERR! node -v v0.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.1
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/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=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bags/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-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-linux-x64.tar.gz' (1)
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/local/bin/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.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/bags/ghost/npm-debug.log

编译报错,卡在这一步好久,分析了一下,我准备连接 mysql 可以跳过 sqlite3 ,于是编辑 ghost 文件夹下 package.json ,找到 sqlite3 ,把它删掉,让编译直接跳过;

8、进入下一步,输入npm start,又不报错了:
ghost@0.5.8 start /home/bags/ghost
node index

Migrations: Up to date at version 003

ERROR: Unsupported version of Node 
Ghost needs Node version ~0.10.0 you are using version 0.12.0 
Please go to http://nodejs.org to get a supported version
root@iZ28ashr6d6Z:/home/bags/ghost# 

    • * *

Ghost needs Node version ~0.10.0 you are using version 0.12.0
已邀请:

烟波湛狂蓝

赞同来自: 刘蒙

ghost 不支持 node 0.12,退到 0.10 吧

[已注销]

赞同来自:

南京整容外科医院h t t p : / / www . elikeme . org
• 选择话题: 选择一个或者多个合适的话题, 让您发布的问题得到更多有相同兴趣的人参与. 所有人可以在您发布问题之后添加和编辑该问题所属的话题

要回复问题请先登录注册