简体   繁体   English

Npm 安装找不到模块“semver”

[英]Npm install cannot find module 'semver'

I can't use npm install using the command prompt in NodeJS.我无法在 NodeJS 中使用命令提示符来使用npm install I'm getting these errors when running npm install :运行npm install时出现这些错误:

module.js:339
    throw err;
    ^
Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\l
ib\config\defaults.js:6:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

I had the same error.我有同样的错误。 npm uninstall npm -g , rm -rf node_modules didn't help me, because when I tried I was getting Error: Cannot find module 'semver' . npm uninstall npm -grm -rf node_modules没有帮助我,因为当我尝试时,我得到了Error: Cannot find module 'semver' But I solve my problem with these steps (this will delete other global modules you may be using):但是我通过这些步骤解决了我的问题(这将删除您可能正在使用的其他全局模块):

  • sudo rm -rf /usr/local/lib/node_modules
  • sudo rm -rf ~/.npm
  • brew uninstall --force node
  • brew install node

Hope this will help those who are getting a similar problem.希望这会帮助那些遇到类似问题的人。

I'm facing the same issue here.我在这里面临同样的问题。

If this occurs right after you run brew install yarn try running yarn global add npm and voilà - fixed!如果在您运行brew install yarn后立即发生这种情况,请尝试运行yarn global add npm和瞧 - 已修复!

如果您在 Linux 服务器中,请从服务器退出并重新 ssh

在 MS Windows 上,解决方案是删除%APPDATA%\npm并重新安装node

I had this too, after running brew install yarn yesterday.我也有这个,昨天运行brew install yarn之后。 At least, everything was fine up until then.至少,在那之前一切都很好。

I ran rm -rf node_modules and tried to reinstall, but no npm command was working.我运行rm -rf node_modules并尝试重新安装,但没有npm命令起作用。

In the end I took the rather simple step of reinstalling Node via the official Node installer for Mac OS X.最后,我采取了相当简单的步骤,通过 Mac OS X 的官方 Node 安装程序重新安装 Node。

https://nodejs.org/en/download/ https://nodejs.org/en/download/

Everything is fine now.现在一切都很好。 Just went back to the directory, ran npm install and it's done the trick.刚回到目录,运行npm install就成功了。

On Ubuntu, if you would rather manage Node through the default repositories using apt , it's best to install both nodejs and npm this way.在 Ubuntu 上,如果您希望使用apt通过默认存储库管理 Node,最好以这种方式安装nodejsnpm

It's very likely that the version of npm you are using is expecting semver in a specific place that is not aligned with the version of Node JS you have installed.您正在使用的 npm 版本很可能会在与您安装的 Node JS 版本不一致的特定位置期待semver If there is only one version of nodejs and only one version of npm , and they are both installed using the default repositories, this should work perfectly.如果只有一个版本的nodejs和一个版本的npm ,并且它们都是使用默认存储库安装的,那么这应该可以完美运行。

Here is my best guidance for getting Node and npm working using the main Ubuntu repositories:这是我使用主要 Ubuntu 存储库让 Node 和 npm 工作的最佳指南:

  1. sudo apt-get purge nodejs --auto-remove and sudo apt-get purge npm --auto-remove sudo apt-get purge nodejs --auto-removesudo apt-get purge npm --auto-remove
  2. whereis node : remove all the versions of node, one at a time. whereis node :删除所有版本的节点,一次一个。 Repeat until this command returns a blank after node: .重复,直到此命令在node:之后返回空白。
  3. sudo apt-get install nodejs
  4. node --version : should return ... no such file or directory node --version : 应该返回... no such file or directory
  5. nodejs --version : should return v1x.xx . nodejs --version :应该返回v1x.xx This is the version installed by apt .这是apt安装的版本。 It will probably be less recent that the latest version available on the Node JS website.它可能比 Node JS 网站上提供的最新版本要晚。
  6. sudo apt-get install npm
  7. npm --version : it will use the nodejs installed by apt and work correctly. npm --version :它将使用apt安装的nodejs并正常工作。

On Arch Linux what did the trick for me was:Arch Linux上,我的诀窍是:

sudo pacman -Rs npm
sudo pacman -S npm

I had the same problem, the way i solved it was by executing我有同样的问题,我解决它的方法是执行

PATH="$PATH"

in terminal, problem was the terminal kept the old path of nodejs instead of using the new one.在终端中,问题是终端保留了 nodejs 的旧路径而不是使用新路径。

刚刚在 Arch Linux 4.13.3 上遇到了这个问题,我通过简单地重新安装semver解决了这个问题:

pacman -S semver

Actually, it is taking the reference of previously stored modules.实际上,它正在引用先前存储的模块。

Solution:Delete the npm-cache/npm folder in the installation directory of nodejs.解决方法:删除nodejs安装目录下的npm-cache/npm文件夹。 In windows, it is in C:/User/Username/Appdata/Roaming/npm(or npm_cache).在 Windows 中,它位于 C:/User/Username/Appdata/Roaming/npm(或 npm_cache)中。 and try to install again.并尝试再次安装。

Same thing to do in any OS.在任何操作系统中都要做同样的事情。

In my case on macOS(10.13.6), when I executed the following command在我的 macOS(10.13.6) 上,当我执行以下命令时

npm install -g react-native-cli

I got this error我收到了这个错误

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

The error got resolved after executing the command执行命令后错误得到解决

yarn global add npm

proposed by @Ashoor由@Ashoor 提出

For me, this happened after I installed yarn globally.对我来说,这发生在我在全球安装 yarn 之后。 To resolve this issue, install npm using yarn and done.要解决此问题,请使用 yarn 安装 npm 并完成。

yarn global add npm
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove

Then install node and npm然后安装node和npm

在 Windows 上,再次下载Node 的 MSI并进行“修复”对我有用。

I had the same issue but it was caused by a broken package-lock.json file.我有同样的问题,但它是由损坏的package-lock.json文件引起的。

Deleting package-lock.json and running npm install again fixed it for me.删除package-lock.json并再次运行npm install为我修复了它。

只需确保已安装semvernpm install -g semver

Just uninstall node js then reinstall it using nvm.只需卸载 node js,然后使用 nvm 重新安装它。 Your problem will be solved.你的问题将得到解决。 I am a debian 10 user.我是一个 Debian 10 用户。

mahedi@debain:~$ curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | mahedi@debain:~$ curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash重击

after executing the command.执行命令后。 close your terminal and reopen then run this command to install node js latest version.关闭您的终端并重新打开,然后运行此命令以安装 node js 最新版本。

mahedi@debain:~$ nvm install v14.15.5 mahedi@debain:~$ nvm install v14.15.5

now check by typing node -v现在通过输入 node -v 检查

This worked for me on Ubuntu (latest version dated Oct/2020)这在 Ubuntu 上对我有用(最新版本日期为 2020 年 10 月)

I had to first get code from the bash source:我必须首先从 bash 源中获取代码:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

This got the latest version of node which updated my libraries and got rid of the 'semver' error.这得到了最新版本的节点,它更新了我的库并摆脱了“semver”错误。

For arch linux对于拱 linux

sudo pacman -Rsc -n nodejs
sudo pacman -Sy nodejs
sudo pacman -Sy npm

Found here: https://github.com/npm/npm/issues/15558在这里找到: https ://github.com/npm/npm/issues/15558

I got same error and I solved it.我遇到了同样的错误,我解决了。

delete package-lock.json file and node_modules folder then npm install删除package-lock.json文件和node_modules文件夹,然后npm install

First you can try close current terminal tab and open new its work fine首先,您可以尝试关闭当前终端选项卡并打开新的它的工作正常

Faced this issue when I ran npm install using a lower version of node.当我使用较低版本的节点运行npm install时遇到了这个问题。 Then later when I upgraded to latest version of node and ran gulp , it has shown this error.后来当我升级到最新版本的节点并运行gulp时,它显示了这个错误。

To resolve, deleted node_modules and re-ran npm install .要解决,删除 node_modules 并重新运行npm install Then gulp ran fine.然后gulp运行良好。

Just a reminder of executable npm execute via node env:只是提醒一下通过node env 执行的可执行npm

xb@dnxb:/tmp$ type -a npm
npm is /usr/bin/npm
npm is /bin/npm
xb@dnxb:/tmp$ realpath /usr/bin/npm /bin/npm
/usr/share/npm/bin/npm-cli.js
/usr/share/npm/bin/npm-cli.js
xb@dnxb:/tmp$ 
xb@dnxb:/tmp$ head -1 /usr/share/npm/bin/npm-cli.js
#!/usr/bin/env node

I can check which node is chosen by type -a , the first line has the most priority, ie I can get same error if I run /usr/local/bin/node /usr/share/npm/bin/npm-cli.js , but no error if I run /usr/bin/node /usr/share/npm/bin/npm-cli.js :我可以检查type -a选择了哪个节点,第一行具有最高优先级,即如果我运行/usr/local/bin/node /usr/share/npm/bin/npm-cli.js ,但如果我运行/usr/bin/node /usr/share/npm/bin/npm-cli.js没有错误:

xb@dnxb:/tmp$ type -a node
node is /usr/local/bin/node
node is /usr/bin/node
node is /bin/node
xb@dnxb:/tmp$ realpath /usr/local/bin/node
/usr/local/bin/node
xb@dnxb:/tmp$ realpath /usr/bin/node
/usr/bin/node
xb@dnxb:/tmp$ realpath /bin/node
/usr/bin/node
xb@dnxb:/tmp$ 

There are 2 unique node exe based on realpath .有 2 个基于realpath的唯一节点 exe。 If you have the similar case, then you need to find out how to remove the undesired/broken node exe, eg sudo rm /usr/local/bin/node or manipulate env $PATH .如果您有类似的情况,那么您需要了解如何删除不需要/损坏的节点 exe,例如sudo rm /usr/local/bin/node或操作 env $PATH

Just remove the /node_modules folder and try again.只需删除 /node_modules 文件夹,然后重试。 ;) ;)

You can use npm rm to remove it.您可以使用npm rm将其删除。

You can also check this issue on GitHub.你也可以在 GitHub 上查看这个问题 To be more specific about unnistal, try to follow this :要更具体地了解 unnistal,请尝试遵循 以下步骤:

Uninstalling卸载

So sad to see you go.看到你走真难过。

sudo npm uninstall npm -g Or, if that fails, sudo npm uninstall npm -g或者,如果失败,

sudo make uninstall More Severe Uninstalling sudo make uninstall 更严重的卸载

Usually, the above instructions are sufficient.通常,上述说明就足够了。 That will remove npm, but leave behind anything you've installed.这将删除 npm,但留下您已安装的任何内容。

If you would like to remove all the packages that you have installed, then you can use the npm ls command to find them, and then npm rm to remove them.如果您想删除所有已安装的软件包,则可以使用 npm ls 命令找到它们,然后使用 npm rm 删除它们。

To remove cruft left behind by npm 0.x, you can use the included clean-old.sh script file.要删除 npm 0.x 遗留的垃圾,您可以使用包含的 clean-old.sh 脚本文件。 You can run it conveniently like this:您可以像这样方便地运行它:

npm explore npm -g -- sh scripts/clean-old.sh npm uses two configuration files, one for per-user configs, and another for global (every-user) configs. npm explore npm -g -- sh scripts/clean-old.sh npm 使用两个配置文件,一个用于每个用户的配置,另一个用于全局(每个用户)配置。 You can view them by doing:您可以通过以下方式查看它们:

npm config get userconfig # defaults to ~/.npmrc npm config get globalconfig # defaults to /usr/local/etc/npmrc Uninstalling npm does not remove configuration files by default. npm config get userconfig # 默认为 ~/.npmrc npm config get globalconfig # 默认为 /usr/local/etc/npmrc 卸载 npm 默认不会删除配置文件。 You must remove them yourself manually if you want them gone.如果您希望它们消失,您必须自己手动删除它们。 Note that this means that future npm installs will not remember the settings that you have chosen.请注意,这意味着未来的 npm 安装将不会记住您选择的设置。

I finally figured this out!我终于想通了! Yes, you have to uninstall/delete all files and reinstall.是的,您必须卸载/删除所有文件并重新安装。 BUT SOME OF THE FILE PATHS ARE TOO LONG TO DELETE DURING THE UNINSTALL PROCESS.但有些文件路径太长,无法在卸载过程中删除。 The file paths are so long in Node that they may not be able to be deleted. Node 中的文件路径太长,可能无法删除。 You have to rename the file paths.您必须重命名文件路径。

After uninstalling Node, use Command Prompt, navigate to ...\Appdata\roaming\ (use the path from the error message).卸载 Node 后,使用命令提示符,导航到 ...\Appdata\roaming\(使用错误消息中的路径)。 Try to delete the folder with del npm.尝试使用 del npm 删除该文件夹。 Then, if it doesn't allow you to delete a folder, start renaming the folders in the file path in the next error message to "a" or something short.然后,如果它不允许您删除文件夹,请开始将下一条错误消息中文件路径中的文件夹重命名为“a”或其他短名称。 You may have to do this for multiple folders along the path.您可能必须对路径上的多个文件夹执行此操作。 Then you should be able to delete!那你应该可以删除了! Then reinstall node and it should work.然后重新安装节点,它应该可以工作。

just remove your node_modules只需删除您的node_modules

rm -rf node_modules

than

yarn

or或者

npm install

Just delete (or rename) the cloned repository's version of semver folder: "gitClonedRepository/App/node_modules/semver"只需删除(或重命名)克隆存储库的 semver 文件夹版本: "gitClonedRepository/App/node_modules/semver"

and copy the "semver" folder from "C:\Program Files\nodejs\node_modules\npm\node_modules\semver"并从"C:\Program Files\nodejs\node_modules\npm\node_modules\semver"复制“semver”文件夹

into the application's node_modules folder.进入应用程序的 node_modules 文件夹。

(if you're on Windows, othervise it must be located somewhere in /usr/local/lib/node_modules). (如果您使用的是 Windows,否则它必须位于 /usr/local/lib/node_modules 中的某个位置)。

我所需要的只是我正在工作的目录中的sudo rm -rf node_modules/ 。这发生在我用n lts更新我的节点版本之后

Nevermind install Yarn.Performs parallel installation resulting in better speed and performance from npm没关系安装 Yarn。执行并行安装,从而提高 npm 的速度和性能

 sudo apt remove yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install yarn -y

就我而言,只需重新运行brew install yarn即可解决问题。

I faced with same trouble after brew installs yarn on my MacOs Sierra 10.12.6. brew 在我的 MacOs Sierra 10.12.6 上安装 yarn 后,我遇到了同样的麻烦。 (And the first try of installation fall after brew update self with a message " Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)". So I re-run it.) (并且第一次安装尝试在 brew update self 之后出现一条消息“Homebrew 必须在 Ruby 2.3 下运行!您正在运行 2.0.0。(RuntimeError)”。所以我重新运行它。)

So I use n manager to reinstall npm.所以我使用 n manager 重新安装 npm。

  • switch to another node version (for my case to 8.0) by "n" command with empty parameters通过带有空参数的“n”命令切换到另一个节点版本(对于我的情况是 8.0)
  • or install new by "n xxx" where xxx the node version number (i need 6.9.1)或通过“n xxx”安装新的,其中 xxx 节点版本号(我需要 6.9.1)
  • delete working version by "n rm xxx" where xxx the node version number.通过“n rm xxx”删除工作版本,其中 xxx 是节点版本号。 use sudo if need如果需要,使用 sudo
  • install working version by "n xxx" where xxx the node version number.通过“n xxx”安装工作版本,其中 xxx 是节点版本号。 use sudo if need如果需要,使用 sudo
  • switch by to the working version of node.切换到节点的工作版本。 (see first step for reference) (参考第一步)

I think the trouble can be caused that node was installed under sudo for case.我认为问题可能是由于节点安装在 sudo 下以防万一。

For Mac users, I tried installing a bunch of new node versions and uninstalling different ones. 对于Mac用户,我尝试安装一堆新节点版本并卸载不同版本。 That didn't fix it. 这没有解决它。 You have to completely wipe out all your installations first. 您必须先完全消除所有安装。 Follow these instructions... How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) . 请按照以下说明操作... 如何完全卸载Node.js,并从头开始重新安装(Mac OS X)

Then download the latest version of node. 然后下载最新版本的节点。

I had the same issue installing on AWS Linux.我在 AWS Linux 上安装时遇到了同样的问题。 I had to install it with sudo .我必须用sudo安装它。 So to get around this I followed step 3 from this article (making sure to get the latest version of node)所以为了解决这个问题,我按照本文的第 3 步进行操作(确保获得最新版本的节点)

https://www.hostingadvice.com/how-to/update-node-js-latest-version/ https://www.hostingadvice.com/how-to/update-node-js-latest-version/

wget https://nodejs.org/dist/vx.x.x/node-vx.x.x-linux-x64.tar.xz
tar -C /home/aUser/node --strip-components 1 -xJf node-vx.x.x-linux.x64.tar.xz

But installed it to the user's home directory /home/aUser/node .但将其安装到用户的主目录/home/aUser/node Then added that path to my PATH.然后将该路径添加到我的 PATH 中。

export PATH=/home/aUser/node/bin:$PATH

After that I was able to do an npm install with no issues.之后,我能够毫无问题地进行npm install

I faced this issues while running project on higher version of cli.我在更高版本的cli上运行项目时遇到了这个问题。 To solve this issue you can simply comment out @angular-devkit/build-angular module and again you have to reinstall it through要解决这个问题,您可以简单地注释掉 @angular-devkit/build-angular 模块,然后您必须再次重新安装它

npm install @angular-devkit/build-angular --save npm install @angular-devkit/build-angular --save

For me, it happened while upgrading to gulp 4 from gulp 3 in my project.对我来说,这是在我的项目中从 gulp 3 升级到 gulp 4 时发生的。 So, when I run "gulp watch" command, it was throwing me same error.所以,当我运行“gulp watch”命令时,它给了我同样的错误。

It's probably due to version mismatch as compared to my globally installed gulp.与我全局安装的 gulp 相比,这可能是由于版本不匹配。

So, either upgrading gulp with "-g" global flag would help, or else I followed this below所以,要么用“-g”全局标志升级 gulp 会有所帮助,否则我在下面遵循这个

However, I used "./node_modules/.bin/gulp watch" in my project.但是,我在项目中使用了“./node_modules/.bin/gulp watch”。 This ensures that all the dependencies that gulp needs are taken from node_modules only.这确保了 gulp 所需的所有依赖项仅来自 node_modules。

i was getting an error saying Permission Denied after running any 'ng' command (ng --version).运行任何“ng”命令(ng --version)后,我收到一条错误消息,提示权限被拒绝。 I googled for a while and tried clearing npm cache npm cache verify , uninstalling my global angular cli ( npm uninstall -g @angular/cli ) and reinstalling Angular/cli ( npm install -g @angular/cli ) etc.. but it would give an error say its already installed.我用谷歌搜索了一段时间并尝试清除 npm 缓存npm cache verify ,卸载我的全局 angular cli ( npm uninstall -g @angular/cli ) 并重新安装 Angular/cli ( npm install -g @angular/cli ) 等。但它会给出一个错误说它已经安装。 but the node_modules folder here wouldn't have any angular folder.. reinstalled node even then restarted my computer.但是这里的 node_modules 文件夹没有任何角度文件夹。即使重新安装了我的计算机,也重新安装了节点。

ANSWER: Finally I found that the ng.cmd and ng.ps1 files in C:\Users\JaGoodwin\AppData\Roaming\npm\ here were still there (in npm folder).. even though I did npm uninstall -g @angular/cli .回答:最后我发现C:\Users\JaGoodwin\AppData\Roaming\npm\中的 ng.cmd 和 ng.ps1 文件仍然存在(在 npm 文件夹中).. 即使我做了npm uninstall -g @angular/cli those files were causing ng (angular/cli) to think it was still installed.这些文件导致 ng (angular/cli) 认为它仍在安装。 i deleted those files then npm install -g @angular/cli@8.3.29 (version i need) I then removed my projects node_modules and then ran npm install and now can run my angular project using ng serve .我删除了这些文件然后npm install -g @angular/cli@8.3.29 (我需要的版本)然后我删除了我的项目 node_modules 然后运行npm install现在可以使用ng serve运行我的角度项目。

在此处输入图像描述

C:\Users\JaGoodwin\AppData\Roaming\npm\

Find this by folder searching %APPDATA% in your windows search bar.通过在 Windows 搜索栏中搜索 %APPDATA% 的文件夹找到它。

Start fresh.重新开始。

brew uninstall --force node
brew install node

I can't use npm install using the command prompt in NodeJS.我无法在NodeJS中使用命令提示符使用npm install I'm getting these errors when running npm install :运行npm install时出现这些错误:

module.js:339
    throw err;
    ^
Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\l
ib\config\defaults.js:6:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

On WSL (so, ~Ubuntu), I faced this problem after having installed both, nodejs and npm through apt , then updated Node using n .在 WSL(所以,~Ubuntu)上,我在通过apt安装了nodejsnpm之后遇到了这个问题,然后使用n更新了 Node。

I was able to resolve it by completely removing apt's installation of npm: sudo apt purge npm .我能够通过完全删除 npm 的 apt 安装来解决它: sudo apt purge npm

This issue usually comes when node js and npm versions are not compatible.当 node js 和 npm 版本不兼容时,通常会出现此问题。 To fix this in Ubuntu (my version was 20)在 Ubuntu 中解决这个问题(我的版本是 20)

  1. Uninstall node js and npm.卸载节点 js 和 npm。
    • apt remove npm易于删除 npm
    • apt remove nodejs易于删除nodejs
    • which node (it will return node js files path)哪个节点(它将返回节点js文件路径)
    • Delete node directory删除节点目录
  2. Install NVM安装 NVM
  3. Install node安装节点
    • nvm install eg nvm install 8.16 nvm 安装 例如 nvm 安装 8.16
    • Above command will itself install node js and its compatible NPM.上面的命令本身会安装 node js 及其兼容的 NPM。

Just check your preinstall scripts if you have one.如果有的话,只需检查您的预安装脚本。 Sometimes to restrict the versions of node and npm one needs to run a project.有时为了限制nodenpm的版本,需要运行一个项目。

If that's the case you need to install semver manually via npm install -g semver如果是这种情况,您需要通过npm install -g semver semver安装 semver

我遇到了同样的问题并通过升级我的Node版本来修复它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM