[乐意黎原创]Node.js 出现Error:Cannot find runtime 'node' on PATH - Visual Studio Code中的解决办法

在调试 node.js时,出现 Error: Cannot find runtime 'node' on PATH,如下图所示.




网上找了好多办法,也没解决。 突然想起,自己安装时选择了 add to path, 应该是路径没有添加到系统环境里,找开变量窗口一看,果然如此。

应该是自己没有重启导致的,于是,重启。果真解决了。


唉,失误害人啊。。。。


乐意黎原创

本文地址:http://blog.csdn.net/aerchi/article/details/53665307

发布了430 篇原创文章 · 获赞 415 · 访问量 925万+
展开阅读全文

ghost 博客搭建遇到问题

02-18

环境: 系统: debian 7.8 php apache mysql 描述: 默认的是sqlite3 报错,我准备用 mysql 连接ghost 修改ghost 文件下config.js production: { url: 'http://blog.koubeidai.com', mail: {}, database: { client: 'mysql', connection: { host : 'localhost', user : '', password : '', database : 'ghost', charset : 'utf8' }, debug: false }, server: { // Host to be passed to node's `net.Server#listen()` host: '127.0.0.1', // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` port: '2368' } }, 在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 这个应该如何解决? 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览