package.json

Install & access a local folder as a npm module

你说的曾经没有我的故事 提交于 2021-02-11 12:32:27
问题 The file structure looks like this: = (main-folder) - package.json - ... = server - index.js - ... = deploy-abc // new server = src - index.js = src - index.js - ... I am trying to install 'deploy-abc' as a module within the main-folder app. So, I ran : yarn add "/var/www/main-folder/deploy-abc" . It installed correctly & I can see the 'deploy-abc' dependency listed in package.json. However, when I try to access the deploy-abc's exported object, I get node error Error: Cannot find module

Protractor option does not work in package.json script

北城以北 提交于 2021-02-11 12:14:15
问题 The following command works as expected: protractor --cucumberOpts.tags='not @tag1' conf.js Now I want to add this command as a script to package.json like this: "scripts": { "my-script": "protractor --cucumberOpts.tags='not @tag1' conf.js" } Running the command npm run my-script gives me the following error: Usage: protractor [configFile] [options] configFile defaults to protractor.conf.js The [options] object will override values from the config file. See the reference config for a full

github actions can not find package.json

我们两清 提交于 2021-02-10 15:07:36
问题 I'm trying to set-up some basic GitHub action to write comments on the PRs. Action is published on github and looks like this: action.yml file: name: !!name!! description: !!description!! author: !!me!! inputs: token: description: "Github token" required: true runs: using: "node12" main: "index.js" index.js file: const core = require("@actions/core"); const { execSync } = require("child_process"); const { GitHub, context } = require("@actions/github"); const main = async () => { const

How to add NODE_PATH to webpack in package.json?

社会主义新天地 提交于 2021-02-09 11:54:11
问题 How do I add NODE_PATH to webpack in package.json? Part of my packcage.json: "dependencies": { "axios": "^0.16.2", "cross-env": "^5.0.1", "koa": "^2.3.0", "koa-mount": "^3.0.0", "koa-static": "^4.0.1", "koa-trie-router": "^2.1.5", "mongodb": "^2.2.31", "nuxt": "^1.0.0-rc3", "socket.io": "^2.0.3" }, "devDependencies": { "babel-eslint": "^7.2.3", "backpack-core": "^0.4.1" }, "scripts": { "test": "mocha --harmony", "dev": "NODE_PATH=./app backpack dev", "build": "nuxt build && backpack build",

error TS5014: Failed to parse file '': Unexpected token u in JSON at position 0. The terminal process terminated with exit code: 1

百般思念 提交于 2021-02-08 12:33:49
问题 I am receiving this error. error TS5014: Failed to parse file '/Users/Documents/tsconfig.json/tsconfig.json': Unexpected token u in JSON at position 0. The terminal process terminated with exit code: 1 My system setup: Visual Studio Code Version 1.14.1 Angular 2 node Version v8.0.0 tsc Version 2.4.1 package.json is as follows { "name": "angular-quickstart", "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": {

Docker error: no such file or directory, open '/package.json'

不羁的心 提交于 2021-02-07 06:12:42
问题 I'm trying to run a node image inside docker but I have this error: npm WARN saveError ENOENT: no such file or directory, open '/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/package.json' npm WARN !invalid#2 No description npm WARN !invalid#2 No repository field. npm WARN !invalid#2 No README data npm WARN !invalid#2 No license field. Here is my docker file. I want to put all my project

Docker error: no such file or directory, open '/package.json'

隐身守侯 提交于 2021-02-07 06:08:54
问题 I'm trying to run a node image inside docker but I have this error: npm WARN saveError ENOENT: no such file or directory, open '/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/package.json' npm WARN !invalid#2 No description npm WARN !invalid#2 No repository field. npm WARN !invalid#2 No README data npm WARN !invalid#2 No license field. Here is my docker file. I want to put all my project

Docker error: no such file or directory, open '/package.json'

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 06:08:14
问题 I'm trying to run a node image inside docker but I have this error: npm WARN saveError ENOENT: no such file or directory, open '/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/package.json' npm WARN !invalid#2 No description npm WARN !invalid#2 No repository field. npm WARN !invalid#2 No README data npm WARN !invalid#2 No license field. Here is my docker file. I want to put all my project

Force yarn install instead of npm install for Node module?

流过昼夜 提交于 2021-02-06 15:13:28
问题 I want to force using yarn install instead of npm install . I want to raise error in npm install . What should I do in package.json ? 回答1: UPDATE: Alexander's answer is the better solution and uses the same technique I describe here. I am leaving my answer in tact for posterity. The original point of my answer was to show that you can execute a small node script which should work on all platforms. In your preinstall script you can run a mini node script which should work on all platforms,

How do you use the 'files' and 'directories' properties in package.json?

人走茶凉 提交于 2021-02-05 12:42:13
问题 If a package.json has a files prop, and/or a directories prop: "files": [ "./src/assets/fonts/" ], "directories": { "assets:": "./src/assets" } What are some ways to make use of them? The documentation does not mention what can be done with them once they have been specified. For example, the files docs say: The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. What does "include in your