Tag: npm

错误在npm安装

当我的node_modules安装一个新的软件包时,出现以下错误: npm install –save [package] npm ERR! path /home/user/Dev/application-name-example/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename '/home/user/Dev/application-name-example/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/home/user/Dev/application-name-example/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A […]

NPM软件包:无法从package.json中parsing模块入口点

我最近创build并发布了我的第一个NPM包。 我熟悉pipe理Nuget包,但我是pipe理NPM包的新手。 我的问题是,当我尝试使用我的包并导入它,我得到一个编译器警告“无法find符号'myClass'在外部模块'myClass.provider.ts'。 我读过npm package.json文档,但是我弄不清楚我做错了什么。 我的package.json对于name和main有以下值: "name": "myCompany.package", "main": "src/myClass.js", 我的导入如下所示: import { myClass } from "myCompany.package"; 在我的包里面,安装之后,入口文件正确地位于src/myClass.Js 。 我错过了什么?

npm安装webpack –save-dev错误

我下载了一个演示“react-redux-demo”,当我使用commond“npm install webpack –save-dev”安装webpack时,显示错误。 这是日志 8351 verbose unlock done using C:\Users\user\AppData\Roaming\npm-cache\_locks\staging-51622fc2de18aa59.lock for D:\work\test\react-redux-demo\node_modules\.staging 8352 warn The package history is included as both a dev and production dependency. 8353 warn The package react is included as both a dev and production dependency. 8354 warn The package react-router-config is included as both a dev and production dependency. […]

npm运行键入错误Windows_NT 6.3.9600

我正在尝试使用下面的命令来运行types npm run typings — install dt ~ core-js –save –global 我正面临着下面的错误,并努力去理解纠正这个问题。请帮助解决scheme,事先感谢。 17 error Windows_NT 6.3.9600 18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "typings" "–" "install" "dt~core-js" "–save" "-global" 19 error node v6.10.3 20 error npm v3.10.10 21 error code ELIFECYCLE 22 error @ typings: `typings "install" "dt~core-js" "–save" "-global"` 22 error Exit status […]

节点库不再工作

我正在尝试使用node-gallery模块。 当我使用代码 app.use('/gallery', require('node-gallery')({ staticFiles : 'resources/photos', urlRoot : 'gallery', title : 'Example Gallery' })); 它工作正常,但是当我试图写我自己的function使用 app.use('/gallery', require('node-gallery')({ staticFiles : 'resources/photos', urlRoot : 'gallery', title : 'Example Gallery', render : false }), function(req, res, next){ //my func, for example: console.log("test"); //return res.send(req.html); }); 它不工作,function只是不执行…文档: https : //www.npmjs.com/package/node-gallery请帮助我。 谢谢。

在部分支持的NodeJS版本上安装软件包时如何打印指定的警告?

我正在研究以安全为导向的平常的替代scheme。 由于paraquire内部问题,在paraquire NodeJS <= 0.11.0上运行NodeJS <= 0.11.0 ,但不能提供全面的保护。 我知道package.json engines选项,但是我想打印一个具有更多信息的特定警告。 我可以做到这一点,而不使用npm安装脚本? (安装脚本往往是不安全的)

如何在构成angular4项目的父目录中引用node_modules

我不太会说英语。 我当前的目录configuration Project ├ node_modules ├ packages │ ├ product │ │ ├ dashboard => don't have "node_modules" directory │ │ │ ├ package.json │ │ │ … │ │ … │ … ├ package.json … 和仪表板目录package.json { "scripts": { "ng": "ng", "start": "ng serve –dev –hmr –port 8460 -pc proxy.conf.js", "build": "ng build –prod […]

未find本地hexo

我尝试按照说明在我的服务器上安装Hexo: [root@VM_150_20_centos ~]# yum install -y nodejs [root@VM_150_20_centos ~]# npm install -g hexo-cli [root@VM_150_20_centos ~]# hexo init blog [root@VM_150_20_centos ~]# cd blog [root@VM_150_20_centos blog]# npm install [root@VM_150_20_centos blog]# hexo generate 当我尝试生成时,有一个错误: [root@VM_150_20_centos blog]# hexo generate /root/blog/node_modules/hexo/lib/extend/tag.js:184 body((err, result) => { ^ ERROR Local hexo not found in ~/blog ERROR Try running: 'npm install hexo –save' […]

使用gulp时,Css样式表有错误的path

我一直在挣扎一段时间,坦白地说,这是相当令人沮丧的。 问题: 我为我的静态网站创build了一个gulp文件,我所要做的就是使用browserSync,将sass编译为css,并将脚本和css文件缩小。 一切工作正常,排除一件事情: 当我运行“gulp”时,除了位于“CSS /”中的de css文件外,所有的东西都会被加载。 显然服务器认为css文件实际上是(“CSS / style.css /”)文件夹。 控制台错误的屏幕截图: 图像 该css文件位于“css / style.css” "use strict"; let paths = { script: "js/*.js", minifiedScript: 'script.min.js', cssPath: "css/*.css", productionFolder: "production", sassPath: "scss/*.scss", htmlFiles: "*.html" }; const gulp = require('gulp'); const concat = require('gulp-concat'); const uglify = require('gulp-uglify'); const sourcemaps = require('gulp-sourcemaps'); const del = require('del'); […]

尝试使用Express在localhost:3000上运行脚本

卡住了我的第一次尝试在一个基本的应用程序。 Scraper.js在控制台中单独运行时,会抓取一个URL并将返回的数组写入文档obj,以便该部分工作。 现在我只想要一个Express服务器来运行脚本,只要我打开localhost:3000,但不知道如何去做。 |node_modules |package.json |public |-index.html (boilerplate HTML. Not importing anything) |src |-scraper.js |index.js index.js: var scraperjs = require('scraperjs'); var express = require('express'); var app = express() app.use(express.static(__dirname + '/public')); app.listen(3000); – scraper.js: scraperjs.StaticScraper.create('https://examplesite.com/') .scrape(function($) { return $(".entry-content p").map(function() { var content = $(this).html(); return content } }).get(); }) .then(function(data) { … // eventually […]