package.json

Transpile server files recursively with babel

ε祈祈猫儿з 提交于 2019-12-11 08:42:46
问题 My folder structure is such: functions -- dist -- private -- server ---- controllers ---- middleware ------- clientAuth.js ------- someOtherAuth.js ---- index.js ---- model.js ---- router.js I want to transpile all the .js files in my server folder into .dist. At present in my package.json I have "scripts": { "prepare": "babel ./server/**/*.js --retain-lines -d ./dist" }, This only transpiles the files in the subdirectories in server, but not the files in the root of server. What can I use to

NodeJS app build is successful (Heroku) but Application Error in heroku at the launch

▼魔方 西西 提交于 2019-12-11 08:42:38
问题 I am using Cloud 9 IDE. Build is successful when I do git add . git commit -m "first_commit" git push heroku master its result is this : Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 280 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime

What does -s mean in npm command?

为君一笑 提交于 2019-12-11 07:34:08
问题 I saw the following command that includes -s option. What does it( -s ) mean? Because I didn't see the option in package.json . $ npm run dev -s 回答1: The flag -s stands for "silent" and is applied to npm , not to the command in the dev script. The -s flag prevents npm from screaming at you when the command exits with a non-zero status, i.e. when the command fails. It also won't create an npm_debug.log file. To test out the difference yourself you can do the following in a new directory. npm

React Build Tool and Dev Server

£可爱£侵袭症+ 提交于 2019-12-11 07:24:44
问题 Need some direction in terms of setting up the DEV environment and server for a project I'm starting for learning purposes. I want to use ReacJS with Bootstrap. Last time I worked with ReactJS, the build and server was already configured and I did not have to do much. We were using npm, gulp and bunch of other stuff. Now that I'm trying to set this up, I'm not sure what to do. Can someone outline the simplest steps I can follow. I want to use latest versions of React eco-system and ideally

Running package.json dependencies when dependencies are not global

此生再无相见时 提交于 2019-12-11 07:12:42
问题 Let's say I have a package.json with "rimraf" as a dependency in it. "rimraf" is not installed globally. What command, from the command prompt, can I enter to run "rimraf"? Something like "npm run-command rimraf?" 回答1: You'd run ./node_modules/.bin/rimraf or if it is some common task, I'd add it to your package.json : "scripts": { "clean": "rimraf ..." } and then call npm run clean . Commands in scripts automatically resolve with ./node_modules/.bin . 来源: https://stackoverflow.com/questions

Error in package.json deploying Angular2 project on Azure using bitbucket

孤者浪人 提交于 2019-12-11 01:57:16
问题 I am facing a issue deploying angular2 app on azure. I get an error on following line "engines":{"node":"6.2.1"}, I have given this version as WEBSITE_NODE_DEFAULT_VERSION has the value 6.2.1. Anyone having idea about this then please share. Here is the error snapshot: package.json looks as follows: { "name": "angular-quickstart", "version": "1.0.0", "engines":{"node":"6.2.1"}, "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": {

NPM Lock down dependency versions in our dependencies package.json

送分小仙女□ 提交于 2019-12-11 00:22:21
问题 So I have an application that pulls in some dependencies. I have figured out how to lock those down quite easily and thus my Package.json looks like so: "webpack": "2.2.1", Great! So webpack is locked to that version, but I have noticed something in webpacks package.json. They don't lockdown their dependencies: "dependencies": { "acorn": "^4.0.4", "acorn-dynamic-import": "^2.0.0", "ajv": "^4.7.0", "ajv-keywords": "^1.1.1", "async": "^2.1.2", "enhanced-resolve": "^3.0.0", "interpret": "^1.0.0"

Can you import a `devDependency` in your code?

让人想犯罪 __ 提交于 2019-12-10 23:43:48
问题 Mobx DevTool's README guides you to install it as dev dependency, and then import it into your code. That seems like a problem to me, because devDependencies, as explained by this SO answer, are: ... used for the build process, tools that help you manage how the end code will end up, third party test modules, (ex. webpack stuff) If that's true, then is it a correct deduction that you shouldn't import a devDependency into your code? 回答1: It depends on how the code that will import the

Why do people store typescript's types as dependency in package.json (instead of devDep)? [duplicate]

喜夏-厌秋 提交于 2019-12-10 23:43:12
问题 This question already has answers here : How do I decide whether @types/* goes into `dependencies` or `devDependencies`? (3 answers) Closed last year . I noticed in almost all tutorials or blog posts about typescript, people just install packages via npm for types and/or typescript related modules as dependency. This is compile-time related thing and end user will never have to load this, so for me logically this should all be impl. detail and thus go to devDependecies part of package.json. I

Error: ENOENT: no such file or directory, open in ionic2

两盒软妹~` 提交于 2019-12-10 22:41:59
问题 I was just creating a new project ionic start blank --v2 and the i gave ionic serve . in my browse i am getting error like below Error: ENOENT: no such file or directory, open '/home/panini/myApp/www/index.html'. this is my output for ionic serve in cmd Running live reload server: http://localhost:35729 Watching: www/**/*, !www/lib/**/*, !www/**/*.map √ Running dev server: http://localhost:8100 Ionic server commands, enter: restart or r to restart the client app from the root goto or g and a