相关疑难解决方法(0)

如何使用NVM设置默认节点版本?

我已经安装了nvm(带zsh shell的ubuntu)和两个节点版本:v6.11.5和v9.0.0,nvm中的默认版本是v9.0.0

每次我需要更改节点版本

$ nvm list
         v6.11.5
->       v9.0.0
         system
default -> node (-> v9.0.0)
node -> stable (-> v9.0.0) (default)
stable -> 9.0 (-> v9.0.0) (default)


$ nvm v6
Run Code Online (Sandbox Code Playgroud)

我怎么能改变nvm版本默认定义v6.11.5?

version node.js nvm

78
推荐指数
21
解决办法
3万
查看次数

错误 /node_modules/node-sass: 命令失败

当我尝试在本地安装 vue store front 但当我尝试“yarn install”命令时,出现以下错误。我该如何解决这个错误?我该如何解决这个错误?

error /var/www/html/vue-storefront/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /var/www/html/vue-storefront/node_modules/node-sass
Output:
Building: /usr/bin/node /var/www/html/vue-storefront/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/bin/node',
gyp verb cli   '/var/www/html/vue-storefront/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info …
Run Code Online (Sandbox Code Playgroud)

node.js vue.js yarnpkg

64
推荐指数
14
解决办法
7万
查看次数

GYP ERR!构建错误.堆栈错误:'make'失败,退出代码为2

我目前正在研究一个nodejs Web应用程序我在使用云代工厂在线推送应用程序时遇到了麻烦.我对错误做了一些研究,似乎可能有一些安装包有一些冲突.

这是package.json文件.

{
  "dependencies": {
    "c3": "^0.4.12",
    "cfenv": "1.0.0",
    "cloudant": "^1.8.0",
    "dygraphs": "^2.0.0",
    "express": "4.5.1",
    "getmac": "1.0.6",
    "http": "0.0.0",
    "mqtt": "1.0.5",
    "properties": "1.2.1",
    "save": "^2.3.0",
    "sockjs": "0.3.9",
    "websocket-multiplex": "0.1.x"
  },
  "description": "description.",
  "license": "UNLICENSED",
  "main": "app.js",
  "repository": {
    "type": "git",
    "url": "<gitUrl>"
  }
}
Run Code Online (Sandbox Code Playgroud)

这是我尝试通过云代工推送应用程序时遇到的错误.在删除node_modules文件夹的所有内容后,我在安装npm时发生类似的错误.

../src/bufferutil.cc:32:50: error: call of overloaded 'NODE_SET_METHOD(v8::Local<v8::FunctionTemplate>&, const char [6], void (&)(const v8::FunctionCallbackInfo<v8::Value>&))' is ambiguous
     NODE_SET_METHOD(t, "merge", BufferUtil::Merge);

../src/bufferutil.cc:32:50: note: candidates are:
In file included from ../src/bufferutil.cc:8:0:
/root/.node-gyp/8.0.0/include/node/node.h:257:13: note: void node::NODE_SET_METHOD(v8::Local<v8::Template>, const char*, …
Run Code Online (Sandbox Code Playgroud)

node.js cloud-foundry gyp npm ibm-cloud

17
推荐指数
7
解决办法
2万
查看次数

纱线安装说是最新的,但无法启动rails控制台

我一直在使用Webpack,Vue.js和Rails开发一个应用程序.两个月没有问题,但是当我尝试启动rails console时无处不在rails c,yarn抱怨包已过时:

error An unexpected error occurred: "Unknown language key integrityNodeDoesntMatch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/maksimfedotov/vras/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.


========================================
  Your Yarn packages are out of date!
  Please run `yarn install` to update.
========================================
Run Code Online (Sandbox Code Playgroud)

然而,当我跑yarn install:

yarn install v1.3.2
[1/4]   Resolving packages...
success Already up-to-date.
?  Done in 0.71s.
Run Code Online (Sandbox Code Playgroud)

我一直在查看yarn和webpacker文档,尝试了各种yarn清理命令,但没有运气.

有趣的是,我仍然可以运行服务器,它唯一抱怨的控制台.

ruby-on-rails webpack ruby-on-rails-5 yarnpkg

13
推荐指数
3
解决办法
2784
查看次数

纱线安装 --check-files 给我错误输出,我不明白

我有一个 Ruby on Rails 项目,正在将其部署在新设置的服务器上。

\n

我运行命令rails s -b 0.0.0.0,它说:

\n
========================================\n  Your Yarn packages are out of date!\n  Please run `yarn install --check-files` to update.\n========================================\n
Run Code Online (Sandbox Code Playgroud)\n

所以我运行它告诉我运行的命令,最终它失败并出现一些我不太理解的错误:

\n
  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/ubuntu/.node-gyp/16.0.0/include/node -I/home/ubuntu/.node-gyp/16.0.0/src -I/home/ubuntu/.node-gyp/16.0.0/deps/openssl/config -I/home/ubuntu/.node-gyp/16.0.0/deps/openssl/openssl/include -I/home/ubuntu/.node-gyp/16.0.0/deps/uv/include -I/home/ubuntu/.node-gyp/16.0.0/deps/zlib -I/home/ubuntu/.node-gyp/16.0.0/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp\nIn file included from /home/ubuntu/.node-gyp/16.0.0/include/node/v8.h:30,\n                 from /home/ubuntu/.node-gyp/16.0.0/include/node/node.h:63,\n                 from …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails yarnpkg

6
推荐指数
1
解决办法
4253
查看次数

NPM:在 Mac OS 上运行安装时出现 libsass 错误

我第一次尝试在本地运行旧版 React 应用程序。我使用的是装有 Big Sur 11.5.2 的新 Mac M1。我的节点版本是 16.9.0,我将 python3 设置为默认值(尽管该应用程序似乎正在寻找 python2)。我还将 CommandLineTools 升级到了最新版本。

但是当我做一个简单的操作时npm install,我收到很多警告,最后出现这个错误:

npm ERR! /Users/cd/.node-gyp/16.9.0/include/node/v8-internal.h:489:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR!             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!                                 ~~~~~^~~~~~~~~~~
npm ERR!                                      remove_cv
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR!                                                  ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error …
Run Code Online (Sandbox Code Playgroud)

node.js npm node-modules node-sass npm-install

5
推荐指数
2
解决办法
3802
查看次数

Heroku 部署资产预编译在 Rails 6 上失败

我需要帮助。当尝试将我的应用程序上传到heroku时,我收到此错误,有人知道为什么吗?

\n

此链接上的完整错误https://pastebin.com/GZCziNpM

\n
remote:          821 |       (node::addon_register_func) (regfunc),                          \\\nremote:              |                                           ^\nremote:        /app/.node-gyp/16.13.1/include/node/node.h:855:3: note: in expansion of macro \xe2\x80\x98NODE_MODULE_X\xe2\x80\x99\nremote:          855 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)\nremote:              |   ^~~~~~~~~~~~~\nremote:        ../src/binding.cpp:358:1: note: in expansion of macro \xe2\x80\x98NODE_MODULE\xe2\x80\x99\nremote:          358 | NODE_MODULE(binding, RegisterModule);\nremote:              | ^~~~~~~~~~~\nremote:        make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1\nremote:        make: Leaving directory \'/tmp/build_6edbe6b2/node_modules/node-sass/build\'\nremote:        gyp ERR! build error \nremote:        gyp ERR! stack Error: `make` failed with exit code: 2\nremote:        gyp ERR! stack     at ChildProcess.onExit (/tmp/build_6edbe6b2/node_modules/node-gyp/lib/build.js:262:23)\nremote:        gyp ERR! stack     at ChildProcess.emit …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails heroku

2
推荐指数
1
解决办法
570
查看次数