Tag: npm install

npm安装package.json中指定的确切软件包版本

目前,如果我运行npm install ,它会安装已安装软件包的更新版本。 我如何安装package.json文件中指定的确切版本?

电子和电子预制有什么区别?

看了很多次的软件包名称,但没有得到什么时候需要安装它,而不是普通的electron …

NPM无法安装types

我有一个npm安装问题,因为它不会安装@types。 这工作正常 npm install –save lodash 然而,要求types不 npm install –save @types/lodash PS C:\Development\Temp> npm install –save @types/lodash npm WARN `git config –get remote.origin.url` returned wrong result (git://github.com/types/lodash) npm WARN `git config –get remote.origin.url` returned wrong result (git@github.com:types/lodash) npm ERR! git clone git@github.com:types/lodash Cloning into bare repository 'C:\Users\myuser\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-lodash-9eb5372a'… npm ERR! git clone git@github.com:types/lodash Host key verification […]

函数不能在控制指令或其他mixin中定义

在我的nodeJS项目突然它给错误,我不做任何升级或更改。 当我在命令行中写入NPM启动时,会给出该错误 ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader? sourceMap&outputStyle=expanded&includePaths[]=c:/TFS/rc1/app/scss&includePaths[] =c:/TFS/rc1/~/compass-mixins/lib&sourceMap&sourceMapContents=true!./app/scss/_toolkit.scss Module build failed: undefined ^ Functions may not be defined within control directives or other mixins. in c:\TFS\rc1\node_modules\compass-mixins\lib\compass\functions\_lists.scss (line 81, column 3) @ ./app/scss/_toolkit.scss 4:14-337 我重新安装compass-mixins软件包,但它仍然给出同样的错误。然后我看了_lists.scss该文件在81行有一个代码。我删除了这个BU它给出同样的错误。我该怎么办? @if not(function-exists(compact)) { @function compact($vars…) { $list: (); @each $var in $vars { @if $var { $list: append($list, $var, comma); } } […]

如何在节点项目中包含引导程序

我有一个使用基本npm命令脚手架的MEAN堆栈项目。 目前,Bootstrap包含在CDN中: link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css') 我的问题是我怎样才能使用npm添加bootstrap,所以这个项目和CDN包含的一样。 特别是当我跑步的时候 npm install bootstrap 在node_modules中创build一个boostrap目录。 但是,如果我尝试从该目录中包含bootstrap.css,则会破坏glyphicon字体。 任何人都可以build议如何做到这一点? PS我也会对AngularJS本身提出同样的问题。

npm后安装types无法正常工作

我有以下packages.json: { "name": "shopping-assistant-angular", "version": "1.0.0", "scripts": { "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ", "tsc": "tsc", "tsc:w": "tsc -w", "lite": "lite-server", "typings": "typings", "postinstall": "typings install" }, "license": "ISC", "dependencies": { "angular2": "2.0.0-beta.7", "systemjs": "0.19.23", "es6-promise": "^3.0.2", "es6-shim": "^0.33.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", "zone.js": "0.5.14" }, "devDependencies": { "bower": "^1.7.7", "concurrently": "^1.0.0", […]

React需要rnpm链接的本地组件依赖

我刚刚为React-Native创build了一个组件,我将尽快将它作为一个包加载到npm中。 虽然我面临一个问题。 该组件依赖于另一个名为react-native-image-resizer npm软件包。 这个软件包需要与rnpm连接才能工作。 虽然,当我只是将我的组件安装在一个全新的项目中时,依赖关系将不会自动链接,并且本地库不会出现在项目中。 当然,当我运行rnpm link ,也不会将其添加到项目中。 所以我想知道什么是最好的方式来安装和链接此依赖? MacBook-Pro:Example $ npm install react-native-image-crop > react-native-image-crop@1.0.0 preinstall /Users/alexmngn/Work/react-native-image-crop/Example/node_modules/.staging/react-native-image-crop-95365d1b > npm install –save react-native-image-resizer react-native-image-crop@1.0.0 (git+ssh://git@github.com/alexmngn/react-native-image-crop.git#90e002c7d0f01c9d61277c30cad375560f09a94a) /Users/alexmngn/Work/react-native-image-crop/Example/node_modules/.staging/react-native-image-crop-95365d1b ├── UNMET DEPENDENCY react-native@^0.31.0 └── react-native-image-resizer@0.0.9 npm WARN react-native-image-resizer@0.0.9 requires a peer of react-native@>=v0.14.2 but none was installed. npm WARN react-native-image-crop@1.0.0 No repository field. – react-native-image-resizer@0.0.9 node_modules/react-native-image-crop/node_modules/react-native-image-resizer Example@0.0.1 […]

如何在“npm install”上安装git钩子?

当有人安装my-package时候,我想安装一个pre-commit git钩子(即丢掉代码)。 我试图添加一个postinstall脚本: "scripts": { "postinstall": "./scripts/install-git-hooks" } 这很好。 当有人运行npm install ,他们会得到pre-commit安装钩子。 但是,如果another-package依赖于my-package ,则为another-package运行npm install也会运行postinstall脚本,这是不希望的。 什么是最干净的方法来避免这种不良影响?

npm ERR! 代码ELIFECYCLE

我只想说感谢,试图帮助我解决这个问题。 我还没有尝试过所有的东西,但我确定地狱已经尝试了一个卡车负载的东西。 我试图学习反应,所以我有这个示例代码为全面反应投票应用程序,我试图得到它的工作,但在运行npm安装之后npm开始我收到以下错误: npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server" npm ERR! node v7.5.0 npm ERR! npm v4.3.0 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! voting_app@1.1.0 server: `live-server –public — host=localhost –port=3000 –middleware=./disable-browser-cache.js` npm ERR! spawn ENOENT npm ERR! npm […]

为什么我不使用npm来安装纱线?

在博客中发布纱线(一种替代的npm客户端),他们说:“最简单的方法就是运行npm install -g yarn ”。 但是如果你到他们的文档中的“安装纱线”页面 ,“npm安装纱线”没有在任何特定于平台的安装页面上列出,并且它仅作为“替代”页面上的三个选项中的第三个提供。 此外,当您npm install纱线时,会打印一个弃用警告,“build议您使用本机安装方法为您的环境安装纱线”。 所以我的问题是,如果npm install是最简单的安装方法,为什么不是在他们的文档推荐的方法? 使用npm安装纱线有缺点吗?