Friday, August 25, 2017

node enoent: no such file or directory package.json



>PROBLEM

The package description is missing.
When it is not found, returns this message:
... ENOENT: no such file or directory ... package.json

npm WARN enoent ENOENT: no such file or directory, open '$HOMEDIR\package.json'


>SOLUTION

Use "npm init" create the package description.
This command asks some questions.
  npm init

To avoid interactive questions, use:
  npm init -y
  npm will assume some default values.

>>Example using the interactive mode with Git

1. Before executing the command, get your git's repository path, do:
  git remote -v

The output as example:
$git remote -v
origin  J:\git\dev\javascript (fetch)
origin  J:\git\dev\javascript (push)


2. Issue init.
The output was copied here as example:
$npm init

This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ˆC at any time to quit.
package name: (bin714)
version: (1.0.0)
description: lab project based on bin714
entry point: (app.js)
test command: appt
git repository: J:\git\dev\javascript
keywords: node,http,server,example,template
author: alsdias plus others
license: (ISC)
About to write to L:\work\devcli_\javascript\node\work\bin714\package.json:

{
  "name": "bin714",
  "version": "1.0.0",
  "description": "lab project based on bin714 ",
  "main": "app.js",
  "scripts": {
    "test": "appt"
  },
  "repository": {
    "type": "git",
    "url": "J:\\git\\dev\\javascript"
  },
  "keywords": [
    "node",
    "http",
    "server",
    "example",
    "template"
  ],
  "author": "alsdias plus others",
  "license": "ISC"
}


Is this ok? (yes)
yes

>ENV
windows
node.js

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...