NPM doesn't publish dependencies

I was spoofing Node and npm packages as CLI applications. I have a project with a package. Json, everything is filled in correctly. When I run my application with different arguments via WebStorm everything works fine. If I publish the npm package, however ... no dependencies ... the npm site cannot find it ... and when I install the CLI app it doesn't work because yes ... the dependencies are not being pulled ...

This is my .json package

 {
  "name": "wmg",
  "version": "0.0.8",
  "description": "A Commandline Foolin around",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/Arvraepe/wmg.git"
  },
  "keywords": ["Stuff", "Foolin"],
  "target": "main",
  "preferGlobal": true,
  "bin": {
    "wmg": "wmg.js"
  },
  "author": "Arne Van Raepenbusch <arvraepe@gmail.com>",
  "license": "ISC",
  "devDependencies": {
    "prompt": "^0.2.14",
    "restify": "^3.0.3",
    "underscore": "^1.8.3"
  }
}

      

I tried to run pakmanager deps but it gave me this strange error

======================= WARNING =======================
Assuming browser mode by default is deprecated.
  Include browserDependencies in your package.json
  -- OR --
  pakmanager -e browser build

In the next release of pakmanager, the node environment will be assumed as default
=======================================================


Targeted Environment: browser
[[[deps]]]
[ERROR] The following packages are `require`d, but not in the package, nor on npm:
  wmg
pakmanager {}


======================= WARNING =======================
Assuming browser mode by default is deprecated.
  Include browserDependencies in your package.json
  -- OR --
  pakmanager -e browser build

In the next release of pakmanager, the node environment will be assumed as default
=======================================================

      

Shouldn't my package depend on itself?

Could someone shed some more light?

+3


source to share


2 answers


I looked at your package, and as others have pointed out, you have devDependencies

, but no dependencies

. Usually devDependencies

intended for things like test frameworks that you need to use for a package, but not use. Both prompt

and restify

are used in your application and must be listed in the object dependencies

instead devDependencies

.



+1


source


There are no dependencies in the package.json file. The only devDependances that npm is supposed to use are only needed for development (like mocha) and not required for installation.



If any of your devDependencies are actual user dependencies, move them in dependencies.

+1


source







All Articles