Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing autoprefixer without package manager #929

Closed
NixBiks opened this issue Oct 20, 2017 · 15 comments
Closed

Installing autoprefixer without package manager #929

NixBiks opened this issue Oct 20, 2017 · 15 comments

Comments

@NixBiks
Copy link

NixBiks commented Oct 20, 2017

I work at a company where there are very strict rules about which software to install. Hence I don't have package manager tools like npm.

Is it possible to install autoprefixer without?

@ai
Copy link
Member

ai commented Oct 21, 2017

Install npm on your machine and then put node_modules to git, so your node_modules will be available on this machine (you don’t need npm to use node_modules).

@ai ai closed this as completed Oct 21, 2017
@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

But if the machine can't install npm? That is my issue. I guess I'll have to accept...

@ai
Copy link
Member

ai commented Oct 21, 2017

You don't need to install npm on every machine. Run npm install on one machine and then copy node_modules. For example, install at home at bring to work on USB stick.

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

For some reason that doesn't work. I use it through a flask app using webassets.

'postcss' is not recognized as an internal or external command

npm install autoprefixer works just fine and installs node_modules. I use win10. I've tried npm install postcss-cli autoprefixer as well without any luck.

@ai
Copy link
Member

ai commented Oct 21, 2017

I am not sure that this error is related to non-npm environment. You get this error when you have wrong path for PostCSS binary.

Try to find correct option and set it to node_modules/.bin/postcss (don't forget to install npm first).

But I am not sure that my recommendation is correct for webassets you should all them. Or on StackOverflow.

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

Ahhh didn't realize the executable were in .bin. Although I now get Input Error: Did not receive any STDIN but that may be how webassets interacts with autoprefixer I suppose.

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

Wuhuu it works. Thank you for your kind help !

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

I might have been too fast. I don't get any error. But the following

:fullscreen a {
  display: flex; 
}

yields

:fullscreen a {
  display: flex; }


/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztFQUVFO0FBQ0Y7RUFDRSxjQUFjLEVBQUUiLCJmaWxlIjoic3RkaW4iLCJzb3VyY2VzQ29udGVudCI6WyIvKiohXHJcbiogQ3VzdG9tIHNhc3NcclxuKi9cbjpmdWxsc2NyZWVuIGEge1xuICBkaXNwbGF5OiBmbGV4OyB9XG4iXX0= */

@ai
Copy link
Member

ai commented Oct 21, 2017

Ask in webassets. Maybe Autoprefixer was not executed? Maybe webassets config is wrong.

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

I will. I've just noticed something with my original issue though. node_modules/.bin/postcss.cmd have the following content

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\postcss-cli\bin\postcss" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\postcss-cli\bin\postcss" %*
)

Hence the machine has to have node.exe, which are only available by installing Node.js. So copying node_modules isn't sufficient as I see it?

@ai
Copy link
Member

ai commented Oct 21, 2017

Yeap. You must have Node.js for it (it is not a package manager, it is JS runtime).

What runtime you use right now?

@NixBiks
Copy link
Author

NixBiks commented Oct 21, 2017

Ah yeh of course. I'm new in this game but now I get it. Sorry for the inconvenience.

@hmsaini
Copy link

hmsaini commented Oct 15, 2018

{
"name": "2-trillo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"node-sass": "^4.9.4"
},
"devDependencies": {
"autoprefixer": "^9.2.0",
"concat": "^1.0.3",
"npm-run-all": "^4.1.3",
"postcss": "^7.0.5"
},
"scripts": {
"watch:sass": "node-sass sass/main.scss css/style.css -w",

"start":"npm-run-all --parallel devserver watch:sass",
"devserver":"live-server",
"compile:sass": "node-sass sass/main.scss css/style.comp.css",
"prefix:css":"postcss --use autoprefixer -b 'last 10 versions' css/style.comp.css -o css/style.prefix.css",
"compress:css":"node-sass css/style.prefix.css css/style.css --output-style compressed ",
"build css":"npm-run-all compile:sass prefix:css compress:css"

},
"author": "Harpreet Saini",
"license": "ISC"
}

@hmsaini
Copy link

hmsaini commented Oct 15, 2018

please help me...i am a window user & each time i got an error...

E:\MyWork\vscode\css\Practice css\css_course2\2-TRILLO>npm run start

[email protected] start E:\MyWork\vscode\css\Practice css\css_course2\2-TRILLO
npm-run-all --parallel devserver watch:sass

[email protected] watch:sass E:\MyWork\vscode\css\Practice css\css_course2\2-TRILLO
node-sass sass/main.scss css/style.css -w

[email protected] devserver E:\MyWork\vscode\css\Practice css\css_course2\2-TRILLO
live-server
'live-server' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] devserver: live-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] devserver 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\hspre\AppData\Roaming\npm-cache_logs\2018-10-15T13_52_58_618Z-debug.log
ERROR: "devserver" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npm-run-all --parallel devserver watch:sass
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\hspre\AppData\Roaming\npm-cache_logs\2018-10-15T13_52_58_971Z-debug.log

E:\MyWork\vscode\css\Practice css\css_course2\2-TRILLO>

@ai
Copy link
Member

ai commented Oct 15, 2018

Sorry, have no idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants