package.json

Heroku does not read node version

家住魔仙堡 提交于 2019-12-05 12:17:50
问题 I have a Node project that I want to host on Heroku. I have explicitly defined node and npm versions in my package.json (located in the root directory), which looks like this: { "name": "*********", "version": "0.0.0", "private": true, "engines": { "node": "0.12.x", "npm": "2.5.x" }, "scripts": { "start": "node ./bin/www" }, "dependencies": { "body-parser": "^1.13.3", ... } However, when I try to push the app to heroku git push heroku master Heroku tries to build the app, but seems not to be

What are these properties prefixing underscore used for in package.json?

北城余情 提交于 2019-12-05 10:53:54
I found these properties prefixing underscore in package.json. What are they used for? why prefixing underscore on properties? "_from": "react-scripts@0.9.3", "_id": "react-scripts@0.9.3", "_inCache": true, "_location": "/react-scripts", "_nodeVersion": "6.0.0", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/react-scripts-0.9.3.tgz_1488303928068_0.6415497597772628" }, "_npmUser": { "name": "gaearon", "email": "dan.abramov@gmail.com" }, Those are meta data reserved for package registries. All properties beginning with _ or $ are reserved for package

EACCES: permission denied, mkdir '/node_modules/node-sass/build' while running npm install on ubuntu

此生再无相见时 提交于 2019-12-05 09:31:18
i have an angular 4 app and i want to run it on ubuntu. i copied all project files , package.json and package-lock.json to a folder in winscp but i didn't copy node_modules! now when i run npm install, i get the errors like this: > node-sass@4.7.2 install /home/ubuntu/cms/node_modules/@angular/cli/node_modules/node-sass > node scripts/install.js Unable to save binary /home/ubuntu/cms/node_modules/@angular/cli/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/home/ubuntu/cms/node_modules/@angular/cli/node_modules/node-sass/vendor' at Object.fs.mkdirSync

npm scripts: need to minify all HTML files in folder (and subfolders)

我只是一个虾纸丫 提交于 2019-12-05 08:45:54
I want to minify all .html files in a folder (and any folders within) using npm run script. Ideally, all .html files should be overwritten (if that's not possible, a new folder is acceptable). It is assumed that there will be non-HTML files in the input folder. npm library minimize works only on per-file but not on folders. Another npm library html-minifier does accept folder as input, but fails if there are any non-HTML files present in the input folder: html-minifier --input-dir ./test1 --output-dir ./test2 --html-5 --collapse-whitespace I need this to minify my static website's HTML files.

npm install: Is there a way to ignore a particular dependency in package.json

核能气质少年 提交于 2019-12-05 07:30:42
I am currently trying to create a docker container for a node.js project that contains a local dependency. This seems to cause an issue with docker so as a workaround I am trying to just copy the local dependency folders and just ignore their dependency entries in the package.json file. Is there a way to specify dependencies I would like to ignore and have npm install run and skip those enties? That can be done using devDependencies The npm modules which you require only to develop, e.g.: unit tests, Coffeescript to Javascript transpilation, minification etc,make the required module a

Unsupported platform for inotify@1.4.1: wanted {“os”:“linux”,“arch”:“any”}

廉价感情. 提交于 2019-12-05 03:52:09
I am coming across a very bizarre error when installing packages for my webpack/reactjs application. I am currently trying to install npm install copy-webpack-plugin --save dev The build/start scripts fail and the following error is shown in the terminal: Unsupported platform for inotify@1.4.1: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"}) This means absolutely noting to me and I cannot find any clear explanations online.I do not know why inotify is needed or when/where it has been installed. Package.json scripts: "scripts": { "start": "node server.js", "build":

How to add multiple NODE_PATH in package.json?

十年热恋 提交于 2019-12-05 03:43:53
How do I add multiple NODE_PATH in package.json? I want to have these multiple paths: NODE_PATH=./ NODE_PATH=./modules/ or NODE_PATH=./lib NODE_PATH=./modules/ package.json: { "name": "my-app", "description": "env", "repository": "https://github.com/xxx.git", "scripts": { "dev": "NODE_PATH=./lib NODE_PATH=./ node server.js", "start": "cross-env NODE_ENV=production NODE_PATH=./ NODE_PATH=./modules/ nodemon --exec babel-node --presets es2015 server.js" }, "dependencies": { "cross-env": "^5.0.5", "express": "^4.15.4" }, "license": "MIT" } server.js: 'use strict' import express from 'express'

How to override package.json main field

回眸只為那壹抹淺笑 提交于 2019-12-05 02:03:57
问题 How can I override the main field of package.json like in bower? "overrides": { "highcharts": { "main": "highcharts.js" } } 回答1: Try creating an alias with the same name as the module in your Webpack config. module.exports = { ... resolve: { alias: { "highcharts": path.resolve(__dirname, "path/to/file") } }, ... }; 来源: https://stackoverflow.com/questions/35989956/how-to-override-package-json-main-field

typescript outDir setting in tsconfig.json not working

眉间皱痕 提交于 2019-12-05 00:06:13
I can't seem to get the outDir flag working when used in package.json . Directory structure is pretty simple: tsconfig.json at the root level, together with a src/ directory and a single index.ts file plus other directories representing other modules. When running the tsc command on the index file, it creates a new one beside it instead of in the build directory. What am I doing wrong? My tsconfig: { "compilerOptions": { "outDir": "build" } } My npm build script: "build": "tsc src/index.ts" I'm calling the script from the root dir of the project. Interestingly, running the same script with an

What is `“dev” true` in package-lock.json for?

被刻印的时光 ゝ 提交于 2019-12-04 22:34:32
What does "dev" true means in package-lock.json file? In my case it is automatically updated when I perform npm operations. How can we remove it? Kyle Reynolds From the npm docs at https://docs.npmjs.com/files/package-lock.json If true then this dependency is either a development dependency ONLY of the top level module or a transitive dependency of one. This is false for dependencies that are both a development dependency of the top level and a transitive dependency of a non-development dependency of the top level. I think this paragraph tries to illustrate how the package dependency's dev: