简体   繁体   English

我可以用纱线代替 npm 吗?

[英]Can i use yarn instead of npm?

I'm super new to node and coding in general so please forgive me.一般来说,我对节点和编码非常陌生,所以请原谅我。 I am trying to use weld scraping service , but I am using npm.我正在尝试使用焊接刮擦服务,但我使用的是 npm。 To run, it says to use a yarn command: yarn dev # development .要运行,它说使用 yarn 命令: yarn dev # development Is there a way I can run the same command with npm?有没有办法可以用 npm 运行相同的命令? I tried npm install dev # development , but it threw an error for the # .我尝试npm install dev # development ,但它为#引发了错误。 I tried downloading the contents of the repository first and then running, and got the same result.我尝试先下载存储库的内容然后运行,并得到相同的结果。 I tried researching what # means in yarn, or in terminal, and the only thing I found is in a shell script it shows that you are the superuser?我尝试研究#在纱线或终端中的含义,我发现的唯一内容是在 shell 脚本中,它表明您是超级用户?

...Yarn can consume the same package.json format as npm, and can install any package from the npm registry. ...Yarn can consume the same package.json format as npm, and can install any package from the npm registry.

https://classic.yarnpkg.com/en/docs/migrating-from-npm/ https://classic.yarnpkg.com/en/docs/migrating-from-npm/

First of all Yarn is a package manager created by Facebook as an alternative to npm.首先,Yarn 是由 Facebook 创建的 package 管理器,作为 npm 的替代品。 It looks like the package you are trying to install can not be installed with npm.看起来您尝试安装的 package 无法与 npm 一起安装。 "npm install dev # development" will not work because it is not the format used by npm when you are trying to install some package. “npm install dev # development”将不起作用,因为它不是 npm 在您尝试安装某些 package 时使用的格式。 If the objective is to scrape a web site I recommend you to use some other popular npm packages as axios cheerio.如果目标是抓取 web站点,我建议您使用其他一些流行的 npm 包,如 axios Cheerio。 You can use "npm install axios cheerio" to use them.您可以使用“npm install axios Cheerio”来使用它们。

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

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