4

I got this error while running npm start used snowpack.dev https://www.snowpack.dev/

snow

[snowpack] ! updating dependencies...
[snowpack] ! installing dependencies…
[snowpack] Package "abstracts/variables" not found. Have you installed it?
[snowpack] Install failed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `snowpack dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-09-15T12_18_05_035Z-debug.log
PS G:\antonio\projects\react\app>

1 Answers1

0

Are you using baseUrl in tsconfig.json?

If you are importing ./src/abstracts as abstracts/[whateverfile] via the baseUrl configuration, you will need to setup an alias (Docs here) in your snowpack configuration file.

  1. Create snowpack.config.js if you have not already done so. Place it in the root of your application, alongside your package.json.

  2. In snowpack.config.js, add:


module.exports = {

    ...

    alias: {
        abstracts: '/src/abstracts',
        // continue for remaining directories in /src
    },

    ...

}


Harley Lang
  • 2,063
  • 2
  • 10
  • 26