sveltefirets icon indicating copy to clipboard operation
sveltefirets copied to clipboard

How to properly package link for local dev and also allow `npm ci` to still work?

Open jacob-8 opened this issue 2 years ago • 2 comments

When I push to the main branch with a new package version, I would GitHub actions to publish the new version, but I get this error upon the action running npm ci:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/sveltefirets/sveltefirets/node_modules/sveltefirets/node_modules/sveltefirets/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/runner/work/sveltefirets/sveltefirets/node_modules/sveltefirets/node_modules/sveltefirets/package.json'
npm ERR! enoent This is related to npm not being able to find a file.

I know it has to do with how I'm referring to sveltefirets as "sveltefirets": "file:./package", in my package.json but don't know to fix. I have set it up this way so after my changes to my package I can run 'npm run package' and Vite automatically updates my demo app. Anyone know how to help me with this?

jacob-8 avatar Nov 22 '21 06:11 jacob-8

@jacob-8 why "sveltefirets": "file:./package",

local dev

 cnpm install
× Install fail! Error: [sveltefirets@file:./package] resolved target D:\Download\audio-visual\saas\deploy\sveltefirets\package error: ENOENT: no such file or directory, lstat 'D:\Download\audio-visual\saas\deploy\sveltefirets\package'

wanghaisheng avatar Apr 06 '22 18:04 wanghaisheng

@wanghaisheng For the moment I recommend copying sveltefirets manually as a folder into your SvelteKit project. There was a problem in Vite which caused SSR bugs when this library was installed. I believe Vite 2.9 fixed this issue (https://github.com/vitejs/vite/pull/7154) but I haven't updated the library yet.

jacob-8 avatar Apr 07 '22 08:04 jacob-8

This issue has been fixed for awhile now.

jacob-8 avatar Aug 20 '22 09:08 jacob-8