我已经有节点0.10.*并且我安装了nvm,然后通过nvm我再次安装了0.11.13和0.10.
node --version返回0.11.13
我尝试使用我读过的一些ES6功能,而我尝试过的任何功能都没有.
我用我的脚本运行 node --harmony index.js
...args
说 SyntaxError: Unexpected token .
let x = 5;
也给出了错误 - SyntaxError: Unexpected identifier
我在哪里可以找到0.11.13目前支持的内容?
假设我有2个项目:
example1: requires node version 0.12.1
example2: requires node version 0.10
Run Code Online (Sandbox Code Playgroud)
目前,当我cd
进入每个项目时,我nvm use <version>
在运行应用程序之前使用.
有没有办法使用node或nvm,当我cd
进入每个项目时自动切换到所需的节点版本?
version: 2.4.2
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
File: /home/user/Documents/myApp/app
The Broccoli Plugin: [object Object] failed with:
Error: watch /home/user/Documents/myApp/app ENOSPC
at exports._errnoException (util.js:870:11)
at FSWatcher.start (fs.js:1234:19)
at Object.fs.watch (fs.js:1262:11)
at NodeWatcher.watchdir (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/sane/src/node_watcher.js:144:20)
at new NodeWatcher (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/sane/src/node_watcher.js:45:8)
at new sane (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/sane/index.js:17:12)
at EventEmitter.Watcher_addWatchDir [as addWatchDir] (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/broccoli-sane-watcher/index.js:93:17)
at /home/user/Documents/myApp/node_modules/ember-cli/node_modules/ember-cli-broccoli/lib/builder.js:95:35
at lib$rsvp$$internal$$tryCatch (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
The broccoli plugin was instantiated at:
at WatchedDir.Directory (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/broccoli-source/index.js:14:31)
at new WatchedDir (/home/user/Documents/myApp/node_modules/ember-cli/node_modules/broccoli-source/index.js:58:13)
at EmberApp._initOptions …
Run Code Online (Sandbox Code Playgroud) 在Ubuntu 16.04上,我错误地使用root来安装nvm,然后通过nvm安装node.js 8.8.1.我也用过nvm alias default 8.8.1
,认为它会纠正我的错误.
现在我想:
看起来我已经成功完成了第一部分:
# nvm unalias default
Deleted alias default - restore it with `nvm alias "default" "8.8.1"`
Run Code Online (Sandbox Code Playgroud)
但是nvm拒绝卸载节点8.8.1,因为它是唯一安装的版本:
# nvm uninstall 8.8.1
nvm: Cannot uninstall currently-active node version, v8.8.1 (inferred from 8.8.1).
Run Code Online (Sandbox Code Playgroud)
我猜我首先需要取消激活节点8.8.1,但我看到输出中没有任何东西nvm --help
看起来会这样做.
在重新正确安装所有内容之前,我需要采取哪些步骤从机器上完全删除node.js,npm和nvm?
我有一个用于安装 nvm 的 Dockerfile。安装后,我需要使用 nvm 安装节点 5.11。问题是,安装 nvm 后,终端需要关闭并再次运行,以便 nvm 命令可用。
我的 docker 文件如下所示:
# Installing Node
RUN Y | curl https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
# RUN bash --login
RUN exec bash
RUN nvm install 5.11.0
# Installing Project dependencies
RUN npm install yarn -g
RUN npm install -g webpack@1.13.2
Run Code Online (Sandbox Code Playgroud)
我得到的输出是:
Step 5/9 : RUN exec bash
---> Using cache
---> cfcdc4c98714
Step 6/9 : RUN nvm install 5.11.0
---> Running in 1874de4a7715
/bin/sh: 1: nvm: not found
The command '/bin/sh …
Run Code Online (Sandbox Code Playgroud) 更改节点的nvm版本时,我遇到了yarn的问题。当我检查〜/ .nvm文件夹时,我注意到有两个节点版本。
我在全球安装了yarn。我在使用v8.11.0时使用npm install -g yarn。
我可以看到我的纱
.nvm/versions/node/v8.11.0
Run Code Online (Sandbox Code Playgroud)
但是,当我切换到nvm v8.11.3或将我的nvm别名默认设置为v8.11.3时,
纱不再可用。我尝试再次进行全局安装,希望将其添加到我的v8.11.3文件夹中,但它一直尝试将其添加到v8.11.0中
我什至删除了文件夹v8.11.0,但是在运行npm install -g yarn时它会重新创建它
如何安装它,以便可以在nvm中使用任何节点版本开关使用yarn
我正在尝试安装一个名为 的包expo-cli
,但它失败了,因为 npm 一直使用错误版本的 node。
我将我的节点版本设置为 v12.4.0,我确认已设置。但是当我运行时npm install -g expo-cli
,它一直在使用v9.10.0
? ~ nvm current
v12.4.0
? ~ node -v
v12.4.0
? ~ npm install -g expo-cli
npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions …
Run Code Online (Sandbox Code Playgroud) 我运行不同的节点版本来在我的计算机上构建不同的 Web 应用程序。我使用 nvm 来管理环境。
我将 VS Code 中的集成终端设置为osx
zsh,如下所示:
"terminal.integrated.shell.osx": "/bin/zsh",
Run Code Online (Sandbox Code Playgroud)
在集成终端中,它似乎正在运行zsh
,我的 nvm 配置正在运行等。
但是当我运行VS Code 调试器时,它没有获取我的 nvm 版本。
当我echo $SHELL
在集成终端中运行时/bin/bash
,即使它似乎正在运行,我也会得到/bin/zsh
。在 iTerm2 中我得到了/bin/zsh
预期的结果。
我需要运行调试器,zsh
以便选择 nvm 配置并在正确的节点版本中运行构建步骤。否则,node-sass 有一个 fit 等,并且我的调试环境与 dev 和 prod 不相符。
如何让 VS Code dubugger 运行zsh
?
顺便说一句:我正在使用 chrome 调试器扩展,它似乎不允许开箱即用的节点版本调试器配置,例如"runtimeVersion": "9.4.0"
.
**
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | 猛击
**
当我在 Mac 上运行此代码时出现错误
crun: 错误: 无效的活动开发者路径 (/Library/Developer/CommandLineTools),在以下位置缺少 xcrun:/Library/Developer/CommandLineTools/usr/bin/xcrun 无法克隆 nvm 存储库。请举报这个!
如何解决这个问题?
我很高兴这个问题已被问过多次,但没有一个答案能够帮助我。
我是终端工作新手,正在尝试在 MacOS Catalina 上使用 nvm 安装节点。我使用“brew install nvm”成功安装了 nvm,但是当我尝试运行“nvm install 10.15.0”时,出现错误“zsh:找不到命令:nvm”。
运行“brew info nvm”给了我这个:
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
Add the following to ~/.zshrc or your desired shell
configuration file:
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
You can set $NVM_DIR to any location, but leaving it unchanged from
/usr/local/opt/nvm will destroy any nvm-installed …
Run Code Online (Sandbox Code Playgroud)