草庐IT

installation-package

全部标签

node.js - 从 package.json "scripts"部分创建 WebStorm 运行配置

在我的package.json文件中,我有以下“脚本”配置。..."scripts":{"start":"watchify-olib/index.js-v-d.","build":"browserify.|uglifyjs-cm>lib/index.js","test":"jest"}...这允许我从命令行运行npmstart、npmbuild和npmtest。这太棒了!但理想情况下,由于界面非常方便,我希望能够使用运行配置从WebStorm中运行这些任务。我一直无法弄清楚如何做到这一点。有没有办法创建我自己的自定义运行配置或从我的package.json自动生成它们?

node.js - 错误 : Couldn't find preset "react" when installed using npm install --global babel-preset-react but works without global flag

我使用npminstall--globalbabel-cli安装了BabelCLI(版本6)。然后我使用npminstall--globalbabel-preset-react安装react预设。然后我将项目目录中的.babelrc文件设置为{"presets":["react"]}当我尝试构建JSX文件时,它失败了Error:Couldn'tfindpreset"react"atOptionManager.mergePresets(/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformat

node.js - 错误 : Couldn't find preset "react" when installed using npm install --global babel-preset-react but works without global flag

我使用npminstall--globalbabel-cli安装了BabelCLI(版本6)。然后我使用npminstall--globalbabel-preset-react安装react预设。然后我将项目目录中的.babelrc文件设置为{"presets":["react"]}当我尝试构建JSX文件时,它失败了Error:Couldn'tfindpreset"react"atOptionManager.mergePresets(/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformat

node.js - npm publish/npm install - 身份验证 token 失效

我认为NPM今天在安全方面有点挣扎,当我在本地项目上运行npminstall时,我得到:'npmWARNnoticeDuetoarecentsecurityincident,allusertokenshavebeeninvalidated.Pleaseseehttps://status.npmjs.org/incidents/dn7c1fgrr7ngformoredetails.Togenerateanewtoken,visithttps://www.npmjs.com/settings/~/tokensorrun"npmlogin"我使用npmlogin再次登录,但出现同样的错误。有

node.js - npm publish/npm install - 身份验证 token 失效

我认为NPM今天在安全方面有点挣扎,当我在本地项目上运行npminstall时,我得到:'npmWARNnoticeDuetoarecentsecurityincident,allusertokenshavebeeninvalidated.Pleaseseehttps://status.npmjs.org/incidents/dn7c1fgrr7ngformoredetails.Togenerateanewtoken,visithttps://www.npmjs.com/settings/~/tokensorrun"npmlogin"我使用npmlogin再次登录,但出现同样的错误。有

node.js - package.json 中的 "style"字段

我注意到Bootstrap和Normalize.css两者的package.json中都有一个“样式”字段。他们为什么有这个?如果我不得不猜测,它是为了让用户像require('bootstrap')一样轻松地导入定义的样式表,但似乎并非如此。 最佳答案 来自Techwraith的pullrequest将其添加到Bootstrap:Manymodulesinnpmarestartingtoexposetheircssentryfilesintheirpackage.jsonfiles.Thisallowstoolslikenpm-c

node.js - package.json 中的 "style"字段

我注意到Bootstrap和Normalize.css两者的package.json中都有一个“样式”字段。他们为什么有这个?如果我不得不猜测,它是为了让用户像require('bootstrap')一样轻松地导入定义的样式表,但似乎并非如此。 最佳答案 来自Techwraith的pullrequest将其添加到Bootstrap:Manymodulesinnpmarestartingtoexposetheircssentryfilesintheirpackage.jsonfiles.Thisallowstoolslikenpm-c

javascript - Node npm package throw use strict : command not found after publish and install globaly

我正在尝试发布npm包,当我在全局安装包并尝试运行cli命令时出现以下错误:/.nvm/versions/node/v0.12.2/bin/myPack:line1:usestrict:commandnotfound/.nvm/versions/node/v0.12.2/bin/myPack:line3:syntaxerrornearunexpectedtoken`('/.nvm/versions/node/v0.12.2/bin/myPack:line3:`var_commandLineArgs=require('command-line-args');'错误所指的文件的顶部:'us

javascript - Node npm package throw use strict : command not found after publish and install globaly

我正在尝试发布npm包,当我在全局安装包并尝试运行cli命令时出现以下错误:/.nvm/versions/node/v0.12.2/bin/myPack:line1:usestrict:commandnotfound/.nvm/versions/node/v0.12.2/bin/myPack:line3:syntaxerrornearunexpectedtoken`('/.nvm/versions/node/v0.12.2/bin/myPack:line3:`var_commandLineArgs=require('command-line-args');'错误所指的文件的顶部:'us

node.js - 在原始 `postinstall` 完成后运行 npm `npm install` 脚本? (也许通过使用 Node 技巧?)

我正在尝试创建一个具有postinstall脚本的npm模块,该脚本将修改用户的package.json并重新安装软件包。我快到了,但我遇到的问题是npmCLI过早地运行我的postinstall脚本。有没有办法(可能通过使用Node或系统级技巧)在我的脚本运行之前等待整个npminstall进程退出?就像当npm调用我的postinstall脚本时,那时我可以注册另一个脚本以在npminstall完成后运行?“太早”是什么意思?例如,在yarninstall之后,如果我的脚本干扰了yarn,yarn.lock文件将无法准确反射(reflect)package.json安装。但是,如果