Last 12 weeks · 0 commits
4 of 6 standards met
Repository: sindresorhus/shell-path. Description: Get the $PATH from the shell Stars: 79, Forks: 13. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v3.1.0 (6mo ago). Open PRs: 0, open issues: 0. Last activity: 6mo ago. Community health: 71%. Top contributors: sindresorhus, silverwind, LitoMore, Richienb.
The inside of shell-path, it seems like using shell-env. It seems like shell-env causes the blow problem. please take a look the below. Thanks. On Terminal with executing "yarn electron:serve" :: require() of ES modules is not supported. require() of .../path-to/node_modules/shell-path/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from ../path-to/node_modules/shell-path/package.json. x On Browser Developer Console :: Uncaught ../path-to/node_modules/shell-path/index.js:1 (function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { import {shellEnv, shellEnvSync} from 'shell-env'; ^^^^^^ SyntaxError: Cannot use import statement outside a module at new Script (vm.js:84:7) at createScript (vm.js:258:10) at Object.runInThisContext (vm.js:306:10) at Module._compile (internal/modules/cjs/loader.js:883:26) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1004:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module._load (electron/js2c/asar.js:769:28) at Module.require (internal/modules/cjs/loader.js:852:19) at require (internal/modules/cjs/helpers.js:74:18)