stencil-cli
stencil-cli copied to clipboard
Stencil start gives stencil-cli out of date error
I'm trying to serve my cornerstone theme locally. I have the latest version of stencil-cli installed (v3.5.0). Im getting the error "not ok -- Error: Error: You are using an outdated version of stencil-cli, please run $ npm install -g @bigcommerce/stencil-cli"
ive tried reinstalling stencil-cli but it didnt help.
Expected behavior
Expected behaviour is upon running strencil start, my stencil theme should start getting served localy.
Actual behavior
I get error "not ok -- Error: Error: You are using an outdated version of stencil-cli, please run $ npm install -g @bigcommerce/stencil-cli"
Steps to reproduce behavior
run stencil start
Please install 3.5.1.
Please install 3.5.1.
it gives the error "not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 404" now
More context here: https://developer.bigcommerce.com/changelog#publications/required-stencil-cli-version-set-to-3-5-0
@AnirudhSingal91 if you're still seeing the issue on 3.5.1
, can you try regenerating your CLI token from the control panel? Sorry for the inconvenience.
@AnirudhSingal91 if you're still seeing the issue on
3.5.1
, can you try regenerating your CLI token from the control panel? Sorry for the inconvenience.
I regenerated the token. im still getting the error "not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 404"
@AnirudhSingal91 I'm getting the same exact error on [email protected]
after updating and using new tokens:
not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 403
It is silly that you FORCE AN UPDATE every time you release a minor version or point release. This has killed half my day (and seems to every time you decide to push a new version).
My team is seeing the same thing as @AnirudhSingal91 and @r724davis. We have tried updating, uninstalling and reinstalling with no luck. Does anyone have a solution or work around?
@zpaquette try updating your API key to include read access on store channels
@zpaquette try updating your API key to include read access on store channels
How does that work? Aren't stencil CLI token and API keys completely independent of each other?
Please install 3.5.1.
To be clear, attempting to resolve this issue led me directly into this concurrent issue: https://github.com/bigcommerce/stencil-cli/issues/768
I had to spend the better part of today trying to figure out what versions of node, npm and stencil-cli work together with no clear guidance from any of the output from stencil-cli. Why was this a forced update, especially with it not working on the latest npm in node 12?
I will mention for myself:
Ran into the outdated stencil cli
error.
After uninstalling stencil-cli
, globally and then installing it again globally on version 3.5.1
, it still wasn't working via npm run start
.
However,
running stencil init
again and then stencil start
seems to work fine for now. Not the greatest experience but at least I can get it running for the interim again.
Having the same issue. Was working just fine yesterday. Tried uninstalling the CLI and reinstalling but get an error like Cannot find module 'mkdirp'
:/
I'm on Node v12.22.1
Update: The workaround mentioned in #768 worked for me 👍
ye, me too ,fk bc
I updated BC,then let me update node ,fk ,wst my time .
This is still not working and it looks like im going to miss an important deadline because of this issue. I still get the error "not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 404".
Any help will be appreciated!
@AnirudhSingal91 Have you tried @steve-ross's workaround in #768 ?
Workaround for NPM 7.x
npm i -g npm@6 npm i -g @bigcommerce/stencil-cli npm i -g npm@latest
@rossyoung5 Yes. didnt work.
@AnirudhSingal91 Have you tried @steve-ross's workaround in #768 ?
Workaround for NPM 7.x
npm i -g npm@6 npm i -g @bigcommerce/stencil-cli npm i -g npm@latest
I opened this one ;)
@steve-ross Yes did so. No help. I end up getting the same error code as before.
@AnirudhSingal91 you can try doing a cache clean after you downgrade to npm@6 with npm cache clean --force
May help to post some more info about your environment. ie: windows / Mac , node version, npm version, etc
@steve-ross Windows 10 node 12.0.0 npm 6.9.0 stencil-cli 3.5.1
You may also want to reinit stencil... I had to do that even though my project was on 3.5.0 OR ensure you have an apiHost in your config.stencil.json
ex:
{
"customLayouts": {
"brand": {},
"category": {},
"page": {},
"product": {}
},
"apiHost": "https://api.bigcommerce.com",
"normalStoreUrl": "https://somewhere.mybigcommerce.com/",
"port": 3000
}
@AnirudhSingal91 @rossyoung5 @HATECORO @drmzio So I was able to get Stencil-CLI to work after doing the following:
- Obtained from store owner new API credentials with full read/write access for every endpoint
- Ran
npm i -g @bigcommerce/stencil-cli
to upgrade to version@3.5.1
- Re-ran
stencil init
which adds an additional key to theconfig.stencil.json
file:"apiHost": "https://api.bigcommerce.com",
- Ran
stencil start
and store was able to run locally
Environment:
npm version: 6.14.12 node version: v12.22.1 Works for at least Cornerstone 2.5.1+
Recommendation for Future Releases:
- When additional keys are added to
stencil.config.json
please make sure to mention that this was added and that it requires re-initializingstencil
in the terminal - If this version requires new API tokens, please tell us this is the case - Don't assume we can read minds or have time to spend half the day troubleshooting something that worked fine the day before. We just want to know what's going on :)
@r742davis I was just typing something like this up... BigC shouldn't introduce breaking changes in point releases. DEFAULT YOUR DAMN VARIABLES!
const apiHost = config.apiHost || 'https://api.bigcommerce.com';
omg @steve-ross @r742davis!! it worked. idk what worked exactly. but it worked. Most probably it was the apiHost that was getting set incorrectly.
yeah, I think is a bug in stencil-cli that is defaulting the apiHost variable to the store url instead of the actual api endpoint
@steve-ross ive been having another issue with stencil bundle command. i get the error "Error: Cannot find module 'babel-plugin-dynamic-import-webpack'". do you have any idea about it?
nope but it looks like your project is missing that package... npm i -D babel-plugin-dynamic-import-webpack
then retry
@steve-ross I tried that. It leads me to Error: Cannot find module 'babel-plugin-transform-regenerator'
when i do npm i -D babel-plugin-transform-regenerator, it leads me to
Error: Cannot find module 'babel-preset-env'
when i do npm i -D babel-preset-env, it leads me to
ERROR in ./assets/js/app.js Module build failed (from ./node_modules/babel-loader/lib/index.js):