jspm / jspm-cli

ES Module Package Manager

Home Page:https://jspm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`jspm map -o dist/import-map.json --production` unable to locate @jspm/core

csr632 opened this issue · comments

jspm map -o dist/import-map.json --production
Get this error:

err (jspm) Error: Unable to locate @jspm/core dependency. Make sure this is properly installed.
    at Mapper.get nodeBuiltinsPkg [as nodeBuiltinsPkg] (/home/csr/.nvm/versions/node/v12.13.0/lib/node_modules/jspm/lib/map/index.js:39:15)
    at Mapper.createMapAll (/home/csr/.nvm/versions/node/v12.13.0/lib/node_modules/jspm/lib/map/index.js:57:34)
    at Object.map (/home/csr/.nvm/versions/node/v12.13.0/lib/node_modules/jspm/lib/map/index.js:190:25)
    at cliHandler (/home/csr/.nvm/versions/node/v12.13.0/lib/node_modules/jspm/lib/cli.js:331:41)
    at Object.<anonymous> (/home/csr/.nvm/versions/node/v12.13.0/lib/node_modules/jspm/lib/cli.js:699:5)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)

My package.json:

{
  "name": "top-app",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "prod-map": "npx --node-arg=--inspect-brk jspm map -o dist/import-map.json --production"
  },
  "devDependencies": {
    "@jspm/core": "^1.0.4",
    "http-server": "~0.11.1",
    "rollup": "^1.26.0",
    "rollup-plugin-node-resolve": "^5.2.0"
  },
  "dependencies": {
    "@micro-frontend-demo/team-a": "^1.0.3",
    "@micro-frontend-demo/team-b": "^1.0.4",
    "systemjs": "^6.1.4"
  },
  "type": "module"
}

@jspm/core is in devDependencies , which is ignored when using --production. Is this intended?
image

Is that means we should put @jspm/core into dependencies and serve it in production?

I have it in dependency but still getting the error.

Using jspm to self install jspm works form me.
i.e. jspm install jspm as local dependency of project.
You have to have some version of jspm installed globally for this command to work.