jspm / jspm-cli

ES Module Package Manager
https://jspm.org
Apache License 2.0
3.79k stars 272 forks source link

Cannot find module C:\Program #2483

Closed dy closed 1 year ago

dy commented 5 years ago

I run jspm following the docs, installing http-server

jspm install http-server --dev
jspm_packages/.bin/http-server.cmd

In the result I see:

internal/modules/esm/default_resolve.js:59
  let url = moduleWrapResolve(specifier, parentURL);
            ^

Error: Cannot find module 'C:\Program' imported from C:\projects\spect\
    at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:59:13)
    at Loader.resolve (internal/modules/esm/loader.js:70:33)
    at Loader.getModuleJob (internal/modules/esm/loader.js:143:40)
    at Loader.import (internal/modules/esm/loader.js:127:28)
    at internal/process/esm_loader.js:44:43
    at Object.exports.initializeLoader (internal/process/esm_loader.js:51:5)
    at initializeESMLoader (internal/bootstrap/pre_execution.js:373:9)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:52:3)
    at internal/main/run_main_module.js:7:1 {
  code: 'ERR_MODULE_NOT_FOUND'

Seems that it doesn't handle spaces in path properly

dy commented 5 years ago

Apparently JSPM_PATH both in http-server and http-server.cmd doesn't handle escapes properly:

https://github.com/jspm/jspm-cli/blob/33c68b5d5e566132c284002018860a4aff1ef159/src/install/bin.ts#L34

https://github.com/jspm/jspm-cli/blob/33c68b5d5e566132c284002018860a4aff1ef159/src/install/bin.ts#L66