Tag: npm install

.npmignore – 忽略所有* .ts文件,而不是* .d.ts

我正在寻找一种很好的方式来在发布到NPM时忽略项目中的所有.ts文件,我可以通过将以下内容添加到我的.npmignore文件中来实现: *.ts 但是等等..实际上我想保留所有的.d.ts文件在我的项目中,当我发布… 什么可以添加到我的.npmignore文件,将保留所有的.d.ts文件,但忽略所有.ts文件? 我假设我必须使用某种forms的正则expression式来忽略以.ts结尾的所有文件,这些文件不以.d.ts结尾 所以这个JS正则expression式可能看起来像: *.\.[^d]\.ts 上述正则expression式应该是什么意思是匹配以.ts结尾的.ts结尾的任何内容 但当然,我们坚持我认为是不那么强大的正则expression式使用的操作系统等。

如何从浏览器中的lite-server中删除“连接到BrowserSync”徽章

我已经通过VS代码控制台安装了John Papa的lite-server NPM软件包,它正在工作。 但是,如何在每次保存文件时删除浏览器中出现的“连接到浏览器同步”徽章,并在浏览器中自动重新加载文件?

离子2-在使用npm install安装node_modules时出错?

我已经安装了最新的Node JS(V8.1.0) ,Ionic和Cordova然后尝试使用npm install命令安装node_modules ,在使用ionic start myApp tabs卡创build的离子演示选项卡项目中,出现以下错误。 我正在使用Windows 10 Pro 。 我已经尝试了很多,但还没有解决这个问题。 任何帮助将不胜感激。 npm install ✖ Running command – failed! [ERROR] An error occurred while running npm install (exit code 1): npm WARN prefer global node-gyp@3.6.2 should be installed with -g > node-sass@4.5.0 install E:\Hybrid Project Locker\NFB\node_modules\node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/win32-x64-57_binding.node […]

Codeship Basic npm安装失败错误:SSL错误:CERT_UNTRUSTED

我遇到了一致的问题,在运行npm install时,我的Codeship Basic设置步骤失败: npm http GET https://registry.npmjs.org/babel-runtime npm ERR! Error: SSL Error: CERT_UNTRUSTED npm ERR! at ClientRequest.<anonymous> (/home/rof/.nvm/v0.6.21/lib/node_modules/npm/node_modules/request/main.js:440:26) npm ERR! at ClientRequest.g (events.js:156:14) npm ERR! at ClientRequest.emit (events.js:67:17) npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7) npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29) npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1288:20) npm ERR! at CleartextStream._push (tls.js:375:27) npm […]

如何让npm 5在添加新的save-dev依赖项后更新locking文件?

在npm 5.0.3中运行npm install redux-observable –save-dev时,locking文件被更新为新安装的软件包(在本例中为redux-observable),但没有现有的package.json中的包。 运行npm install尝试刷新或重新生成locking文件不起作用。

我是否应该将所有子包保存在package.json中的单个版本中?

我的项目使用的第三方库已经将其function分割为多个导入的包,以便项目可以安装它所需的东西。 在package.json中,不同的子包有几个条目,比如… "dependencies": { "@lib/dogs": "^1.0.3", "@lib/cats": "^1.0.3", "@lib/iguanas": "^1.0.3" …lots more of the same… } 如果其中一个子包通过semver-range-picking安装不同的版本号,而另一个开发人员通过在一个子包上递增版本来解决问题,我不想花时间考虑兼容性问题。 如果子包版本不同步,我怀疑存在一些bug的风险,即使包维护者的意图是尊重破坏版本变化的含义。 只是默认情况下,所有的子软件包都在相同的版本上似乎更简单。 我应该尝试执行(或者至less是提升)子包具有相同的版本吗?

如何解决npm安装在非MAC操作系统上抛出fsevents警告?

npm install命令正在引发以下警告 – npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\rea ct-scripts\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} ) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch okidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} ) 警告显然是导致我们的jenkins工作标记失败,所以我们只是试图摆脱相同的。 我已经检查了这个https://stackoverflow.com/a/42938398/351903但是,不同于在那里提到的,我没有任何/ […]

如何在本地安装npm包

我已经下载了下面的demo和ng2-archwizard 我想进行更改,以便对本地ng2-archwizard的源代码进行更改,并在本地安装此演示项目的包。 我尝试的第一件事是通过以下步骤npm link 在ng2-archwizard里面,我改变了代码并运行了npm link 在演示项目中,我安装了ng2-archwizard,使用npm link \path\to\ng2-archwizard或者npm link ng2-archwizard 当我运行ng serve我得到以下错误 chunk {0} main.bundle.js,main.bundle.js.map(main)984 kB {4} [initial] [rendered] 块{1} polyfills.bundle.js,polyfills.bundle.js.map(polyfills)191 kB {5} [initial] [rendered] chunk {2} styles.bundle.js,styles.bundle.js.map(styles)175 kB {5} [initial] [rendered] chunk {3} scripts.bundle.js,scripts.bundle.js.map(scripts)168 kB {5} [initial] [rendered] chunk {4} vendor.bundle.js,vendor.bundle.js.map(vendor)2.83 MB [initial] [rendered] 块{5} inline.bundle.js,inline.bundle.js.map(内联)0字节[条目] [呈现] 遇到错误时遇到静态parsing符号值。 函数调用不被支持。 考虑使用对导出函数的引用(原始.ts文件中的位置194:50)来replace函数或lambda,parsing/ usr / xxx […]

npm:从现有的依赖关系树添加依赖关系

我有一个使用vuetable-2和vue-axios的Vue应用程序,在app.js有以下导入 import Vue from 'vue' import VueMaterial from 'vue-material' import axios from 'axios' import VueAxios from 'vue-axios' 没有直接在package.json的依赖部分有axios ,eslint会抱怨 [eslint] 'axios' should be listed in the project's dependencies. 我已经在axios中有./node_modules作为vue-axios依赖项的一部分。 └─┬ vuetable-2@1.6.6 └── axios@0.15.3 运行npm install –save axios将获取最新版本的axios并将其添加到package.json ,但现在我在依赖项中有两个版本的axios ├── axios@0.17.0 └─┬ vuetable-2@1.6.6 └── axios@0.15.3 我如何重新使用属于vuetable-2依赖关系的vuetable-2 ?

Ember-CLI“你没有这个文件的权限”

上周我开始修补Ember框架。 我真的开始喜欢它,但是当我尝试用ember <command>运行任何Ember-CLI命令时,它向我抛出以下错误: /usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:46 throw err; ^ Error: EACCES, permission denied '/home/mattias/.config/configstore/ember-cli.json' You don't have access to this file. at Object.fs.openSync (fs.js:439:18) at Object.fs.readFileSync (fs.js:290:15) at Object.create.all.get (/usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:27:26) at Object.Configstore (/usr/lib/node_modules/ember-cli/node_modules/configstore/index.js:20:44) at clientId (/usr/lib/node_modules/ember-cli/lib/cli/index.js:22:21) at module.exports (/usr/lib/node_modules/ember-cli/lib/cli/index.js:64:19) at /usr/lib/node_modules/ember-cli/bin/ember:26:3 at /usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:46:14 at process (/usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:173:43) at ondir (/usr/lib/node_modules/ember-cli/node_modules/resolve/lib/async.js:188:17) 起初我以为它和Ember或者npm有关系,所以我试着重新安装npm,NodeJS和Ember,但是每当我想使用Ember-CLI的时候,总是会给出错误信息。 感谢您的build议。