I just installed Shopify’s ‘Slate’ package using npm.
Terminal shows that the package was added to ‘/.npm-packages/lib’.
However, when I attempt to build a new shopify theme using the command ‘slate theme newthemename’, the command isn’t found…
…even though slate clearly was installed.
Curious to figure out what I’m doing wrong, so any help/advice is much appreciated!
2
Answers
Please execute the below command from your terminal.
npm link @shopify/slate
Basically this command creates a symlink to your package folder, it will check for the global (npm) modules first, and will check for the local modules if there is no match.
Hope this helps!
Your installation of slate is successful. However, the slate program (
slate/lib/index.js
) is not added to environment variablePATH
, that’s why errorcommand not found
is reported.To fix this issue, a simple method is add
slate/lib/index.js
toPATH
manually. For example, create a symbolic link in/usr/local/bin/
and make it point toslate/lib/index.js
:Please note the first parameter of
ln -s
must be absolute path. If relative path is used, Mac OS X (I’m on 10.12.6) won’t help to translate it.